Nice job with the: incf FILEREG, F dcfsnz FILEREG, F ; here if zero ; here if not zero hitech dude I figure he is either calling a routine or setting a bit or byte in which case something like: if you want X<0>=0 if FILEREG=0 or X<0>=1 if FILEREG=1 bcf X, BIT ; X = 0 tstfsz FILEREG, F ; skip if FILEREG = 0 bsf X, BIT ; X = 1 is far superior and with no intermittent side effects On Sun, 23 May 1999, Jamil J. Weatherbee wrote: > Lame I agree. But the 17Cxxx are built so you don't really need to use > that instruction of using the appropriate paradigm. > Here is a low efficiency replacement: > > COMF FILEREG, F > COMF FILEREG, F > > > On Tue, 25 May 1999, TYR130010 wrote: > > > Hello all, I am a recent convert to PIC devices, and writing for 17C756. > > > > I have noticed one particularly irritating short coming; > > you can't do an equivalent: MOVF "FILEREG",F in the 17C devices > > like you can in the 16C devices to change the Z flag. > > The TSTFSZ works if you want to Skip on zero, but there is no > > complementary "TSTFSNZ" instructions. > > The nice thing about the TSTFSZ is it affects only the Z flag, and no > > other registers or flags. > > > > Maybe there are some old hands who have created macros that do the > > job as efficiently as possible with minimal impact on, or disturbance > > to any registers who wouldn't mind sharing them with everyone. > > > > Or if not, maybe a little game perhaps, to see who can come up with > > the neatest, most useful, compact, and documented ( so everyone can - > > - understand ) macro? > > > > I feel this would be a very useful subject for novice programmers. > > While we're at it, we might as well cover some of the ground rules > > for use of Macro's, such as you don't use them immediately after a > > "Test and Branch" instruction for obvious reasons. > > > > I will venture this "glove" in the spirit of being taught my place. > > You never know I just "might" learn something new ;) > > > > This macro started as a joke, but it does with W what the complement > > of TSTFSZ WREG would do . > > > > ; Tests WREG without disturbing it, and only affects > > Z flag. > > TSTWSNZ MACRO > > IORLW 00H ; Won't affect value > > in W > > BTFSC ALUSTA,Z ; SKIP IF W <> ZERO > > ENDM > > > > > > hfoster@tyler.net > > > >