In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eMAN wrote: [color=black]Hello,[/color] [color=black]Ran into a question that has me puzzled...[/color] [color=#996600] [/color] [color=black]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. [/color] [color=#996600] [see attached "vars"][/color] [color=black][/color] [color=#996600] [/color][color=black]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.[/color] [color=#996600] [see attached "Debugger screen"][/color] [color=black]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.[/color] [color=black]Can you help me understand this?[/color] [color=black][/color] [color=black]Using: IDE 3.2.3, SASM 1.51.07, SXB 1.51.03, SXSim 2.08.05[/color] [color=#996600] [/color] [color=black]Thanks for your help,[/color] [color=#996600]_______________________________[/color] [color=#996600]Don Gille[/color] [color=#996600] [/color] [color=#996600][/color] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=188828 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)