@Bean, error loading wordparameter (negative constant)
Bean,
I have a function
fmtString·FUNC·1,5,5,byte,word,byte,byte,byte
and use it like this:
· sStr = fmtString -128,10,@ascii,7··'value=-128, output="-128",0
This compiles into:
SX/B assumes incorrectly that the constant is positive and smaller than 256.
When using
· sStr = fmtString -1280,10,@ascii,7··'value=-1280, output="-1280",0
it compiles into:
This is correct.
The first should be:
regards peter
Post Edited (Peter Verkaik) : 3/26/2009 2:13:20 PM GMT
I have a function
fmtString·FUNC·1,5,5,byte,word,byte,byte,byte
and use it like this:
· sStr = fmtString -128,10,@ascii,7··'value=-128, output="-128",0
This compiles into:
823 002D 0C80 MOV __PARAM1,#-128 ; sStr = fmtString -128,10,@ascii,7 'value=-128, output="-128",0 002E 0028 824 002F 0069 CLR __PARAM2 825 0030 0C0A MOV __PARAM3,#10 0031 002A 826 0032 0C50 MOV __PARAM4,#ascii 0033 002B 827 0034 0C07 MOV __PARAM5,#7 0035 002C 828 0036 0010 CALL @__fmtString 0037 0908 829 0038 0208 MOV sStr,__PARAM1 0039 002E
SX/B assumes incorrectly that the constant is positive and smaller than 256.
When using
· sStr = fmtString -1280,10,@ascii,7··'value=-1280, output="-1280",0
it compiles into:
823 002D 0C00 MOV __PARAM1,#(-1280) & 255 ; sStr = fmtString -1280,10,@ascii,7 'value=-1280, output="-1280",0 002E 0028 824 002F 0CFB MOV __PARAM2,#(-1280) >> 8 0030 0029 825 0031 0C0A MOV __PARAM3,#10 0032 002A 826 0033 0C50 MOV __PARAM4,#ascii 0034 002B 827 0035 0C07 MOV __PARAM5,#7 0036 002C 828 0037 0010 CALL @__fmtString 0038 0908 829 0039 0208 MOV sStr,__PARAM1 003A 002E
This is correct.
The first should be:
823 002D 0C00 MOV __PARAM1,#(-128) & 255 ; sStr = fmtString -1280,10,@ascii,7 'value=-128, output="-128",0 002E 0028 824 002F 0CFB MOV __PARAM2,#(-128) >> 8 0030 0029
regards peter
Post Edited (Peter Verkaik) : 3/26/2009 2:13:20 PM GMT
Comments
Yep, another optimization attempt that backfired...
I'll get that fixed and post again ASAP.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Peter, let me know if you get a chance to test it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Seems to work now.
Thanks.
regards peter