home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / dse-src6.dms / in.adf / BOUNCHSRCS.LZH / BIN-HEX.S < prev    next >
Encoding:
Text File  |  1987-05-18  |  312 b   |  21 lines

  1. *
  2. * Convert Binary to HexaDecimal!
  3. * Value to be converted in D0 (long Word)
  4. * Result in H_OUTPUT
  5. *
  6.  
  7. h_binhex:
  8. lea h_hextab,a1
  9. lea h_output,a0
  10. addi.l #8,a0
  11. move.l #7,d1
  12. h_loop:
  13. move.l d0,d2
  14. and.l #15,d2
  15. move.b (a1,d2),-(a0)
  16. lsr.l #4,d0
  17. dbra d1,h_loop
  18. rts
  19. h_hextab: dc '0123456789abcdef'
  20. h_output: dc '        '
  21.