Shop OBEX P1 Docs P2 Docs Learn Events
IF statement generates weird code with SNZ instruction — Parallax Forums

IF statement generates weird code with SNZ instruction

eMANeMAN Posts: 1
edited 2007-05-02 22:21 in General Discussion
Hello,
Ran into a question that has me puzzled...
·
I have a program developed for the SX52 (will be a 48 in production) which compares two 8 bit numbers.· One number is declared a byte the other is·a word.·
·[noparse][[/noparse]see attached "vars"]
·When I code the IF statement I use the _LSB of the word to compare with the byte variable.· Needless to say, the code does not work correctly.· The compare fails when the debugger shows me that the subtract yields a 0 and the zero flag is set.
·[noparse][[/noparse]see attached "Debugger screen"]
The generated code (I'm not an expert in SX .. .yet) seems to be weird.· The SNZ instruction is followed by a page instruction then a jump.· It would appear that the code will not operate correctly.
Can you help me understand this?

Using: IDE 3.2.3, SASM 1.51.07, SXB 1.51.03, SXSim 2.08.05
·
Thanks for your help,
_______________________________
Don Gille
·

Post Edited By Moderator (Chris Savage (Parallax)) : 5/2/2007 9:35:02 PM GMT
1280 x 940 - 176K

Comments

Sign In or Register to comment.