Shop OBEX P1 Docs P2 Docs Learn Events
Bug? — Parallax Forums

Bug?

ThadThad Posts: 7
edited 2006-11-22 19:22 in General Discussion
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

Comments

  • ThadThad Posts: 7
    edited 2006-11-20 23:55
    I also tried Switches = ~SInp but got a compiler error.

    Thx
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-11-22 19:22
    Thad,

    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
Sign In or Register to comment.