; reference on PICList which is truely a good place for studing PIC assmbling
; course 3 of PIC MCU in YNU
;
; no CopyRight
; Mar,12 2009 edited by Seraph
include "p16f877a.inc"
hundreds equ 0x20
tens equ 0x21
ones equ 0x22
org 0
goto main
org 4
goto int_srv
int_srv:
main:
movlw 0xff
call bin2bcd
bin2bcd:
clrf tens
clrf hundreds
decf hundreds, f
decf tens, f
movwf ones
div10_tens
incf tens
movlw 0xa
subwf ones, f
btfsc STATUS, C
goto div10_tens
movlw 0xa
addwf ones, f
div10_hundreds
incf hundreds
movlw 0xa
subwf tens, f
btfsc STATUS, C
goto div10_hundreds
movlw 0xa
addwf tens, f
;transmit them through 'call put232' or 'call putLCD'
;
ret
end