hotrodhed120
Member
Just a quick question. What does the $ symbol mean/equate in this code mean? It is not in my pic mcu quickchart. The code needs to go into a 16f870. I found this code in a delay code generator at piclist.com
; Delay = 0.5 seconds
; Clock frequency = 4 MHz
; Actual delay = 0.5 seconds = 500000 cycles
; Error = 0 %
cblock
DELAYP5
DELAYP5_1
DELAYP5_2
endc
DelayP5
;499994 cycles
movlw 0x03
movwf DELAYP5
movlw 0x18
movwf DELAYP5_1
movlw 0x02
movwf DELAYP5_2
DelayP5_0
decfsz DELAYP5, f
goto $+2
decfsz DELAYP5_1, f
goto $+2
decfsz DELAYP5_2, f
goto DelayP5_0
;2 cycles
goto $+1
;4 cycles (including call)
return
; Delay = 0.5 seconds
; Clock frequency = 4 MHz
; Actual delay = 0.5 seconds = 500000 cycles
; Error = 0 %
cblock
DELAYP5
DELAYP5_1
DELAYP5_2
endc
DelayP5
;499994 cycles
movlw 0x03
movwf DELAYP5
movlw 0x18
movwf DELAYP5_1
movlw 0x02
movwf DELAYP5_2
DelayP5_0
decfsz DELAYP5, f
goto $+2
decfsz DELAYP5_1, f
goto $+2
decfsz DELAYP5_2, f
goto DelayP5_0
;2 cycles
goto $+1
;4 cycles (including call)
return