home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / CONV20.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  916b  |  41 lines

  1.     page    66,132
  2. ;******************************** CONV20.ASM *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( CONVERT )
  14. BYTE_TO_DEC_STDOUT - display byte as decimal to stdout
  15. ;
  16. ; inputs  al = byte
  17. ; output  none
  18. ;* * * * * * * * * * * * * *
  19. 
  20.     extrn    stdout_char:far
  21. ;----------------------------------------------------------------------------
  22. ; inputs al = binary
  23. ;
  24.     public    byte_to_dec_stdout
  25. byte_to_dec_stdout    proc    far
  26.     push    ax
  27.     aam            ;convert byte to bcd
  28.     or    ax,3030h    ;add in ascii
  29.     xchg    al,ah
  30.     call    stdout_char
  31.     xchg    al,ah
  32.     call    stdout_char
  33.     pop    ax
  34.     retf 
  35. byte_to_dec_stdout    endp
  36.  
  37. LIBSEG    ENDS
  38.     end
  39.  
  40.