; TITLE "SB2H - Syslib 4.0" NAME ('ATB2H') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Date : 28 Oct 89 ; Version : 1.1 ; Module : SB2H ; Abstract: This module includes the routines @B2HH and @B2HL which ; return a Hexidecimal character representation of the High ; and low nybbles respectively of the character in register A. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC @B2HH, @B2HL .Z80 CSEG ;=============================================================== ; NAME - @B2HH ; Entry: A - Contains the nybble to be converted to a Hexi- ; decimal chacter in the Most Significant bits (7-4). ; Exit : A - Contains a Hexidecimal character, flags are destroyed ; Uses : AF ; Special Requirements: None ;=============================================================== @B2HH: RRCA ; Reverse the two nybbles RRCA RRCA RRCA ;..fall thru to Next Module ;=============================================================== ; NAME - @B2HL ; Entry: A - Contains the nybble to be converted to a Hexi- ; decimal chacter in the Low Order bits (0-3). ; Exit : A - Contains a Hexidecimal character, flags are destroyed ; Uses : AF ; Special Requirements: None ;=============================================================== @B2HL: AND 0FH ; Mask off high nybble, keep lower ADD A,90H ; Now to a tricky conversion to Hex DAA ADC A,40H DAA RET END