At 03:08 PM 3/14/01 -0800, you wrote: >Given the following code snippets, would someone be nice enough to explain >why method-1 gets a fixup overflow error, but method-2 does not. I >understand why method-1 generates an error, but do not understand how >method-2 fixes it when both "movwf (_dlyctr ^0x80)" and "movwf _dlyctr" >compile to 00B4. (Setting bank select bits in the STATUS register to bank-1 >or not makes no difference) > >bank1 unsigned char dlyctr; (compiler places "dlyctr" at 0xB4) > >method-1 >#asm > movlw 0x03 > movwf _dlyctr > decfsz _dlyctr,f >#endasm > >method-2 >#asm > movlw 0x03 > movwf (_dlyctr ^0x80) > decfsz (_dlyctr^0x80),f >#endasm > > >Sam.... Assuming you understand that (_dlyctr^0x80) should evaluate to 0x34, then you probably looked at the compiled code and saw 0xB4, but didn't realize that it's the movwf opcode that provided the "extra" bit. It's just a lookalike. movwf = 00 0000 1xxx xxxx 0x34 = 011 1000 ---------------- "0xB4" = 00 0000 1011 1000 Barry -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics