In SX Microcontrollers, SX/B Compiler and SX-Key Tool, rodneymc wrote:
Welp, I just hit 19 Variables on the SX28 and wanted to add some more functionality.
Referencing the help file on Variables, I'm seeing:
[table cellSpacing=0 cellPadding=4 border=1]
[tr bgColor=#cfcfcf][td align=left width=75]Device[/td][td align=middle width=75]General[/td][td align=middle width=125]Arrays[/td][td align=middle width=75]Max. Array[/td][/tr][tr ][td align=left] SX18/20[/td][td align=middle]20[/td][td align=middle]6x16 + 1x5 + 1x4[/td][td align=middle]16 (each)[/td][/tr][tr ][td align=left] SX28[/td][td align=middle]19[/td][td align=middle]6x16 + 1x5 + 1x4[/td][td align=middle]16 (each)[/td][/tr][tr ][td align=left] SX48/52[/td][td align=middle]17[/td][td align=middle]223[/td][td align=middle]223[/td][/tr][/table]
Looking at my code I have:
* 6 Word Variables = 12 Bytes
* 7 Byte Variables
* 3 element Array of type Byte
* 3 I/O Ports
So, as far as from what I've read from [url=http://forums.parallax.com/forums/default.aspx?f=7&m=146212]SX/B RAM Banking Scheme[/url], I'm understanding that now I would need to use arrays and an alias for any other variables.
[b]1. How do I determine how much variable space do I have left?[/b]
Mapping out the remaining space, I was curious how are I/O ports part of the variable mapping, and how much actual variable space I have left:
It looks like I have the following available:
* 1X5
* 1X1 (using 3 elements of the 1X4)
* 6X16 > Is this where the max 16 comes from in the table?
[b]2. In the case of aliasing, shouldn't they function as a regular variable?[/b]
[code]myValue Word
index VAR byte(3)
i VAR index(0)
j VAR index(1)
k VAR index(2)
j = 3
Lookup j, CON1, CON2, CON3, CON4, CON5, CON6, myValue
When I comple this, I get a 'BYTE VARIABLE EXPECTED: "j"' error.
3. Within my program, have a a incrementing counter. Based on that counter, I want to lookup a position for a predefined address label, and use it in the read statement later on in my programm.
I initially tried using the WDATA statement, as in
[code]
WDATA LABEL1, LABEL2, LABEL3, LABEL4, LABEL5
[/code]
The compiler didn't like it. Should this work?
In finding an alternative, I used a real byte instead of an array, on #2 above,
[code]
myValue VAR Word
i VAR Byte
i = 3
LOOKUP i, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, myValue
The compiler liked it better, but still complains with the following:
Warning 73, Pass 2: Mulit-byte instruction following skip instruction.
Looking at the assembly shows that it looks like it's doing what I want. Is there any concern?
Is there another alternative, to do what I want to do other than multiple if-then's? Branching won't work since I don't actually want to execute the code at the addresses.
Thanks!
Rodney
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=147040
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)