TB025
ASCII2Hex
movwf
movlw
subwf
movlw
andwf
btfsc
goto
movlw
subwf
ASCIIOut
movf
return
end
Temp1
'0'
Temp1,F
0xf0
Temp1,W
STATUS,Z
ASCIIOut
'A'-'0'-0x0a
Temp1,F
Temp1,W
;Convert value to binary
;Subtract ASCII 0 from number
;If number is 0-9 result, upper nibble
; should be zero
;Otherwise, number is A - F, so
;subtract off additional amount
;Value should be 0 - 15
DS91025A-page 6
© 1998 Microchip Technology Inc.