Shop OBEX P1 Docs P2 Docs Learn Events
SX/B address testing — Parallax Forums

SX/B address testing

pjvpjv Posts: 1,903
edited 2008-06-23 01:12 in General Discussion
Hi all;

I'm trying to see if SX/B will be suitable for some of my needs, and I'm trying to do some assembler vs SX/B comparisons.

So I'm just learning SX/B.

In SX/B one can do an IF-Condition-Then statement where the condition is the comparison between two 16 bit words. All is fine. However when I want to compare a 16 bit word to a defined label, I get a BYTE PARAMETER EXPECTED message, and quoting the label.

Example...······I cannot get this·to work

····· Pointer var word

····· IF Pointer > Table THEN Exit

Exit:

Table:
······ DATA ......

Am I doing something wrong?

I can of course work around this by first·assigning the address to a temporary·16 bit variable, and then using that in·the comparison, but this means extra code which I expect should not be neccessary.

Example...······this does work

····· Pointer var word
····· Temp var word

····· Temp = Table
····· IF Pointer >·Temp THEN Exit

Exit:

Table:
······ DATA ......

Cheers,

Peter(pjv)

Comments

  • JonnyMacJonnyMac Posts: 9,392
    edited 2008-06-23 01:12
    I confirmed and agree with your assertion: since the table address is being resolved as a constant you should be able to use it as such. I even tried to move the table location ahead of the comparison -- that didn't work, either.
Sign In or Register to comment.