Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list p=PIC18f8722
- #include p18f8722.inc
- ; Begin
- code 0
- goto initialize
- udata
- a res .1
- b res .1
- c res .1
- ; Start
- PRG code
- initialize
- ; Set a and b here
- main
- comf b, W ; c = a - b
- addlw .1
- addwf a, W
- movwf c
- tstfsz c ; c == 0
- bra not_equal
- movlw .0
- movwf a
- movwf b
- bra exit
- not_equal
- btfsc c, 7
- bra a_gt_b
- comf c, W
- addlw .1
- movwf b
- bra exit
- a_gt_b
- movwf a
- exit
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement