newbie111
Member level 2
delay
My two questions are
What does " $ +2 " mean"?
and take delay 250 ms for an example
how these codes make the delay 250ms delay?
Please explain it to me
Thanks a lot
Code:
Delay255 movlw 0xff ;delay 255mS
goto d0
Delay250 movlw d'250' ;delay 250mS
goto d0
Delay100 movlw d'100' ;delay 100mS
goto d0
Delay50 movlw d'50' ;delay 50mS
goto d0
Delay20 movlw d'20' ;delay 20mS
goto d0
Delay10 movlw d'10' ;delay 10mS
goto d0
Delay1 movlw d'1' ;delay 1mS
goto d0
Delay5 movlw 0x05 ;delay 5ms
d0 movwf count1
d1 movlw 0xE7
movwf counta
movlw 0x04
movwf countb
Delay_0 decfsz counta, f
goto $+2
decfsz countb, f
goto Delay_0
decfsz count1 ,f
goto d1
retlw 0x00
My two questions are
What does " $ +2 " mean"?
and take delay 250 ms for an example
how these codes make the delay 250ms delay?
Please explain it to me
Thanks a lot