home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / ATOHEX.AZM / ATOHEX.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  640 b   |  23 lines

  1. ;----------------------------------------------------------------
  2. ;         This is a module in the ASMLIB library
  3. ;
  4. ; Convert the accumulator character into a hex digit
  5. ;
  6. ;            Written         R.C.H.     16/8/83
  7. ;            Last Update    R.C.H.       16/8/83
  8. ;----------------------------------------------------------------
  9. ;
  10.     name    'atohex'
  11. ;
  12.     public    atohex
  13.     extrn    caps
  14. ;
  15. atohex:
  16.     call    caps            ; make upper case
  17.     sui    '0'
  18.     cpi    10            ; check range
  19.     rc                ; return since it is 0..9
  20.     sui    'A' - '0' - 10        ; make into hex digit then
  21.     ret                ; all easy tooooooo
  22. ;
  23.