Hi, The code decfsz del_y,f The F must be a 0 if you want the result going to the W register and a 1 if you want the result going back to the register del_y. I would also use one of the general registers for storage 0Ch up Hope it helps. Bye For Now Eric Naus At 03:41 PM 6/3/97 PST8, you wrote: > I'm having problems with some very simple code. The MPLAB 3.22 > simulator seems to stick on 07H in this routine when decrementing > the variable del_y. What am I doing wrong? > > > > ;Initial program setup for PIC84 > > COUNT EQU 008H ;Tim's Counter DEL_Y constant > DEL_Y EQU 00H ;Tim's DEL_Y Variable > > > ;some more program stuff... > > > MOVLW COUNT ;Put the COUNT in W (accumulator) > MOVWF DEL_Y ;Move COUNT to f (DEL_Y) > COUNTR DECFSZ DEL_Y,F ;F-1 --> DEL_Y > GOTO COUNTR; ;*** Simulator gets stuck between > ;*** here and "COUNTR" > > > > TIA, > > Tim Crist >