PICDebugger APPLET
You can also try to compile a program (copy the code below and paste it in the applet).
Exemple :
C var 0
Z var 2
f var 1
STATUS var 0x03
Numerator var 0x0C
Denominator var 0x0D
Q var 0x0E
R var 0x0F
i var 0x10
temp var 0x11
reset:
goto main
main:
movlw 11
movwf Numerator
movlw 5
movwf Denominator
call div
goto reset
div:
movf Numerator,w
movwf Q
clrf R
movlw 8
movwf i
div_loop:
bcf STATUS,C
rlf Q,f
rlf R,f
movf Denominator,w
subwf R,w
btfsc STATUS,Z
goto div_sub
movwf temp
btfsc temp,7
goto div_continue
div_sub:
movf Denominator,w
subwf R,f
bsf Q,0
div_continue:
decfsz i,f
goto div_loop
return
end
DBA 2000 |