*``````````````````````````````*
* HEX2HEXASC ::                *
*                              *
*-                            -*
*-                            -*
* CLOBBERS:                    *
*                              *
* FLAGS:  ????----  REG: AXYM  *
*-                            -*
* CYCLES: ???                  *
* SIZE:                        *
*-                            -*
* USAGE:                       *
*                              *
*-                            -*
* ENTRY                        *
*                              *
* TOP OF STACK                 *
*                              *
* LOW BYTE OF RETURN ADDRESS   *
* HI BYTE OF RETURN ADDRESS    *
*-                            -*
* EXIT                         *
*                              *
* TOP OF STACK                 *
*                              *
* LOW BYTE OF RETURN ADDRESS   *
* HI BYTE OF RETURN ADDRESS    *
*                              *
* .Y = COUNTER; TRASH          *
* .X = COUNTER; TRASH          *
* .A = LOW BYTE OF RET ADDR    *
*                              *
* [RETURN] = STRING VALUE      *
* [RETLEN] = LENGTH OF STRING  *
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
*
HEX2HEXASC
*
** SAVE RETURN ADDRESS
*
         PLA
         STA   RETADR
         PLA
         STA   RETADR+1
*
** GET PARAMETERS
*
         PLA   :HBYTE
         STA   :HBYTE
*
         LDA   :HBYTE
         AND   #$F0       ; MASK RIGHT
         LSR
         LSR
         LSR
         LSR
         STA   :LEFT
         LDA   :HBYTE
         AND   #$0F       ; MASK LEFT
         STA   :RIGHT
         LDX   :LEFT
         LDA   :HEXTAB,X
         STA   :LEFT
         LDX   :RIGHT
         LDA   :HEXTAB,X
         STA   :RIGHT
*
** TRANSFER TO [RETURN]
*
         LDA   :LEFT
         STA   RETURN
         LDA   :RIGHT
         STA   RETURN+1
         LDA   #2
         STA   RETLEN
*
** RESTORE RETURN ADDRESS
*
         LDA   RETADR+1
         PHA
         LDA   RETADR
         PHA
*
         RTS              ; RETURN
*
** VARIABLES
*
:LEFT    DS    1
:RIGHT   DS    1
:HBYTE   DS    1
:HEXTAB  ASC   "0123456789ABCDEF"
*
