Bug?
Hi,
·I seem to be here a lot today.. I have an interesting problem and it appears to be a compiler issue. I have the code:
ReadSwitches:
· Switches = SInp··
\ NOP··
· Switches = ~Switches
· \ nop
Return
·Which compiles to:
ReadSwitches:
MOV FSR,#Switches······································ ;· Switches = SInp
MOV IND,SInp
MOV FSR,#$10
NOP···························································· ;\ NOP
MOV FSR,#Switches······································ ; Switches = ~Switches
MOV W,/IND
MOV __PARAM2,W
MOV FSR,#$10
NOT __PARAM2
MOV FSR, #Switches
MOV IND,__PARAM2
MOV FSR,#$10
NOP····························································; \ nop
The problem is that the MOV W,/IND inverts the bits then the NOT __PARAM2,W does it again returning switches to the original state. I have used this successfully with switches in the Base page but when switches is at address $20 it does not work.
Anyone got a clue?
Thad
·I seem to be here a lot today.. I have an interesting problem and it appears to be a compiler issue. I have the code:
ReadSwitches:
· Switches = SInp··
\ NOP··
· Switches = ~Switches
· \ nop
Return
·Which compiles to:
ReadSwitches:
MOV FSR,#Switches······································ ;· Switches = SInp
MOV IND,SInp
MOV FSR,#$10
NOP···························································· ;\ NOP
MOV FSR,#Switches······································ ; Switches = ~Switches
MOV W,/IND
MOV __PARAM2,W
MOV FSR,#$10
NOT __PARAM2
MOV FSR, #Switches
MOV IND,__PARAM2
MOV FSR,#$10
NOP····························································; \ nop
The problem is that the MOV W,/IND inverts the bits then the NOT __PARAM2,W does it again returning switches to the original state. I have used this successfully with switches in the Base page but when switches is at address $20 it does not work.
Anyone got a clue?
Thad
Comments
Thx
What version of the SX/B compiler are you using? The latest is Version 1.51.03.
The condition you are describing sounds similar to the one reported in this post.
- Sparks