;
; SYSLIB Module Name:  SLA2HC
; Author:  Richard Conn
; SYSLIB Version Number:  2.0
; Module Version Number:  1.0
; Module Entry Points:
;	LA2HC
; Module External References:
;	EN		LOUT
;

;
;  LA2HC --
;	PRINT REG A AS 2 HEXADECIMAL CHARACTERS ON LST:
;
	EXT	LOUT
	EXT	EN

LA2HC::
	PUSH	PSW	; SAVE A
	PUSH	PSW
	CALL	EN	; EXCHANGE NYBBLES
	CALL	PAHC	; PRINT LOW-ORDER NYBBLE AS HEX
	POP	PSW	; GET A
	CALL	PAHC	; PRINT LOW-ORDER NYBBLE AS HEX
	POP	PSW	; RESTORE A
	RET
PAHC:	ANI	0FH	; MASK FOR LOW NYBBLE
	CPI	10	; LETTER OR DIGIT?
	JC	PADIG	; DIGIT IF CARRY
	ADI	'A'-10	; CONVERT TO 'A'-'F'
	CALL	LOUT	; PRINT
	RET
PADIG:	ADI	'0'	; CONVERT TO '0'-'9'
	CALL	LOUT	; PRINT
	RET

	END
