Does this work if CHOICE1, CHOICE2 and CHOICE3 are GPR's and not litterals ? It's MPASM that does the "^" thing, isn't it ? Of course, "fixed" command tables may be more common then tables with dynamicly changing choice's. Jan-Erik. -----Original Message----- From: Andrew Warren [mailto:aiw@CYPRESS.COM] Sent: den 26 juni 2003 03:00 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Comparing between 2 bytes QAC wrote: > On the 18-series there is a "compare" instruction that does not > change anything > .... > Nice for "command-tables" since you don't have to reload WREG > between the compares. Jan-Erik: You don't have to reload WREG, even without a non-destructive "compare" instruction: MOVF COMMAND,W XORLW CHOICE1 BZ DOCOMMAND1 XORLW CHOICE2^CHOICE1 BZ DOCOMMAND2 XORLW CHOICE3^CHOICE2 BZ DOCOMMAND3 etc... -Andy P.S. Before anyone asks... The "BZ" pseudo-op is clearly documented in the MPASM User's Guide somewhere in or near Appendix B, and in the MPASM.HLP file under Instruction Sets:12-Bit Core Instruction Set:12- Bit/14-Bit Core Special Instruction Mnemonics. === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads