Darkstar64
New Member
Well I tried to get as close to 24 hours I could but I got to around 23.93 and thats pretty fine for me its using the 509 by the way just bc its small and there is a size concern anyone know if this is correct or not ?
Code:
delay_23.9 ; Delay 24.9 hours
movlw .250 ; Outer loop : 250x (999+999+999+999+999+999+999+999+3) -1+3+4
movwf dc2 ; = 1,998,000 = 2 second
movlw .250
movwf dc1
movlw .173
movwf dc3
dly1 nop ; Inner loop 1 = 250 x 4-1 = 999 cycles
decfsz dc1,f
goto dly1
dly2 nop ; Inner loop 2 = 999 cycles
decfsz dc1,f
goto dly2
dly3 nop ; Inner loop 3 = 999 cycles
decfsz dc1,f
goto dly3
dly4 nop ; Inner loop 4 = 999 cycles
decfsz dc1,f
goto dly4
dly5 nop ; Inner loop 5 = 999 cycles
decfsz dc1,f
goto dly5
dly6 nop ; Inner loop 6 = 999 cycles
decfsz dc1,f
goto dly6
dly7 nop ; Inner loop 7 = 999 cycles
decfsz dc1,f
goto dly7
dly8 nop ; Inner loop 8 = 999 cycles
decfsz dc1,f
goto dly8
decfsz dc2,f
goto dly1
decfsz dc2,f ; 2 x 250 = 8.3 min's
goto dly1
decfsz dc3,f ; 8.3 min's x 173 = 1435.9 min's/60 = 23.93 hours
goto dly1
retlw 0
Last edited: