Wrong code generation of the SX/B
Jens
Posts: 3
Hi,
I fear I found an error in the SX/B compiler. Please have a look at the following code snippet:
·MOV bTemp,#%00100001·········· ;·bTemp = %00100001
·MOV bCode,bTemp··············· ;·bCode = bTemp··············· ' read code
·AND bCode,#%00001111·········· ;·bCode = bCode & %00001111····' low nibble contains morse code
·MOV bCodeSize,bTemp··········· ;·bCodeSize = bTemp
·MOV __PARAM1,bCodeSize········ ;·bCodeSize = bCodeSize >> 4···' number of dots/dashes per char
·AND __PARAM1,#$0F
·SWAP __PARAM1
·MOV bCodeSize,__PARAM1
I want to shift the higher nibble of the bCodeSize to the lower nibble. In the result of code generation the compiler masked the __PARAM1 first with the $0f and then swaped the nibble, isn't it?
Regards,
Jens
·······
I fear I found an error in the SX/B compiler. Please have a look at the following code snippet:
·MOV bTemp,#%00100001·········· ;·bTemp = %00100001
·MOV bCode,bTemp··············· ;·bCode = bTemp··············· ' read code
·AND bCode,#%00001111·········· ;·bCode = bCode & %00001111····' low nibble contains morse code
·MOV bCodeSize,bTemp··········· ;·bCodeSize = bTemp
·MOV __PARAM1,bCodeSize········ ;·bCodeSize = bCodeSize >> 4···' number of dots/dashes per char
·AND __PARAM1,#$0F
·SWAP __PARAM1
·MOV bCodeSize,__PARAM1
I want to shift the higher nibble of the bCodeSize to the lower nibble. In the result of code generation the compiler masked the __PARAM1 first with the $0f and then swaped the nibble, isn't it?
Regards,
Jens
·······
Comments
You are correct. The code should do the SWAP first, then the AND. I'm pretty sure this has come up before, so it should be fixed in the next version.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
Not a problem. I changed the code, using the swap command directly instead of shifting the bits.
Regards,
Jens
everyones talking about the propeller, and rightly so, but if you look around this forum, you can see the lack of posting for the last lil bit.
i really cant justify going out and buying another dev board for 140 dollars, when i just bought the sxtech a while ago.. am enthralled with the promise i see in the sx chips paticularly the $10 sx48 boards, would like to see the propeller come that way too.. but at the same time i am anxiuosly awaiting the next rev so i can easily use 16 bit basic.. i pointed out a problem with sx/b about· 2 months ago and they said that the next rev was coming soon........
dan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Sounds like the trials and tribulations of a successful company. Congratulations!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax