; ==============================================
; ASCII_Hex conversion routine...
ASC_Hex: CJNE A, #'0', Ch_1 ; Test for ASCII numbers..
Ch_1: JC Ch_Bad ; Character is less than a '0'..
CJNE A, #'9'+1, Ch_2 ; Test value range..
Ch_2: JC Ch_Val_109 ; Character is between 0 and 9..
CJNE A, #'A', Ch_3 ; Test for upper case hex letter..
Ch_3: JC Ch_Bad ; Character is less than 'A'..
CJNE A, #'F'+1, Ch_4 ; Test value range..
Ch_4: JC Ch_Val_AF ; Character is between A and F..
Ch_Bad: SETB ErrFlag5 ; Character is not a Hex number..
LJMP ASC_Hex_Exit
Ch_Val_AF: CLR C
SUBB A, #07h
Ch_Val_109: CLR C
SUBB A, #'0'
CLR ErrFlag5
ASC_Hex_Exit:RET
; ===================================================