;
;****************************************************************************
;
; Description:
; Convert Value In Acc From Hex To BCD.
;
; Entry Requirements:
; Acc Has Value In Binary To Convert To BCD
;
; On Exit:
; Acc Has Entry Value Converted To BCD
;
; Affected:
; PSW.CY, PSW.Z, PSW.P, Acc
;
; Stack:
; 1 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; Values Greater Than 99 Will Not Work Properly.
;
;****************************************************************************
UTIL_BINTOBCD proc
push b ; Save B
mov b,#10 ; Divide By 10
div ab ; Do Divide
swap a ; Move Result To High Of A
orl a,b ; OR In Remainder
pop b ; Recover B
ret ; Return To Caller
endproc