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

  1. ;----------------------------------------------------------------
  2. ;        This is a module in the ASMLIB library
  3. ; Convert a HEX number in DE into 4 ASCII bytes --> by HL
  4. ;
  5. ;            Written         R.C.H.     16/8/83
  6. ;            Last Update    R.C.H.       16/8/83
  7. ;----------------------------------------------------------------
  8. ;
  9.     name    'hexasc'
  10. ;
  11.     public    hexasc
  12.     extrn    atoasc
  13.     maclib    z80
  14. ;
  15. hexasc:
  16.     push    b            ; save
  17.     mvi    b,2
  18. hexasc2:
  19.     push    d            ; save
  20.     mov    a,d
  21.     xchg                ; DE -> memory destination
  22.     call    atoasc
  23.     xchg                ; now HL -> memory, DE = ascii bytes
  24.     mov    m,d
  25.     inx    h
  26.     mov    m,e            ; all done
  27.     inx    h
  28.     pop    d            ; restore original conversion btyes
  29.     mov    d,e            ; get it ready
  30.     djnz    hexasc2
  31. ; all done
  32.     pop    b
  33.     ret
  34.  
  35.     end
  36.  
  37.  
  38.