home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / wattcp.zip / OUTHEX.ASM < prev    next >
Assembly Source File  |  1991-09-04  |  1KB  |  65 lines

  1. PAGE    66,132
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7. ;
  8. ;
  9. ;
  10. ;  outhex.asm
  11. ;
  12. ;  print a hex byte to standard out
  13. ;
  14. ;
  15. ;  Usage :
  16. ;        outch( ch )
  17. ;
  18. ;  (c) 1990 University of Waterloo,
  19. ;           Faculty of Engineering,
  20. ;           Engineering Microcomputer Network Development Office
  21. ;
  22. ;  version
  23. ;
  24. ;    0.1    7-Nov -1990   E. P. Engelke
  25. ;
  26. ;
  27.     include masmdefs.hsm
  28.     include    model.hsm
  29.  
  30. codedef OUTHEX
  31. datadef
  32.  
  33.         cextrn outch
  34.  
  35. cstart  OUTHEX
  36.  
  37. h1      proc near
  38.         mov     AL, +@AB [BP]    ; get byte
  39.         and     AL, 0fh
  40.         cmp     AL, 9
  41.         jle     @1
  42.         add     AL, 'A' - '9' - 1
  43. @1:     add     AL, '0'
  44. ;
  45. ;        mov     AH, 2
  46. ;        int     21h
  47.         push    AX
  48.         ccall    outch
  49.         pop     AX
  50.         ret
  51. h1      endp
  52.  
  53. cpublic outhex
  54.         mov     AL, +@AB [BP]
  55.         mov     CL, 4
  56.         shr     AL, CL
  57.  
  58.         mov     DL, AL
  59.         call    h1
  60.         mov     AL, +@AB [BP]
  61.         call    h1
  62. creturn outhex
  63. cend    OUTHEX
  64.         end
  65.