;=================================
;INPUT: DH
;OUTPUT:
;This subroutine displays the hexadecimal digits
;of the content of DH.
;AX and BX are preserved.
;BX and DL are destroyed.
HEX PROC
push AX
push DS
mov AX, CS
mov DS, AX ; DS == CS
mov AL, DH ; make a copy
shr AL, 4
mov BX, OFFSET Hexdigit
xlatb ; equiv. to mov AL, [BX+AL]
mov DL, AL
mov AH, 2
int 21h
mov AL, DH
and AL, 0Fh
xlatb
mov DL, AL
mov AH, 2
int 21h
mov DL,'h'
mov AH, 2
int 21h
pop DS
pop AX
ret
HexDigit DB '0123456789ABCDEF'
HEX ENDP
|