Well, let's try this again. A while back I had some problems with INTEGER arithmetic since the newest version. I returned to this tonight and located one problem. Here's the Basic code:
rh = 256*[integer]values(1)+values(2) ;this is 10*rh
copy = values(3) & 0x7F ;save copy of byte 3, less sign
cels = 256*[integer]copy+values(4) ;this is 10*Celsius
And here's the ensuing assembler:
;rh = 256*[integer]values(1)+values(2) ;this is 10*rh
banksel RH ;***** BANKSEL
;copy = values(3) & 0x7F ;save copy of byte 3, less sign
;cels = 256*[integer]copy+values(4) ;this is 10*Celsius
movwf CELS ;***** NO BANKSEL
Note the missing BANKSEL. Even though the Basic lines are virtually the same, for whatever reason the BANKSEL fails to appear in the second line. If I manually add it, this portion of the code works as expected.
Okay, I went ahead and used WORD variables instead of INTEGER variables. I kept everything the same throughout.
It works perfectly.
So, the bug is definitely in the INTEGER arithmetic routines.
Bug confirmed and fixed. Releases after April 28th 2014 have a fix for this issue.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.