home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / mscwattc / elib / outs.asm < prev    next >
Encoding:
Assembly Source File  |  1992-01-14  |  969 b   |  69 lines

  1. PAGE    66,132
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7. ;
  8. ;
  9. ;
  10. ;  outs.asm
  11. ;
  12. ;  print a string to stdio
  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 OUTS
  31. datadef
  32.  
  33.         cextrn  outch
  34.  
  35. cstart  OUTS
  36. cpublic outs
  37.     push    DS
  38.     push    si
  39.     lds    SI, +@AB [BP]
  40. @1:    lodsb
  41.         or      AL, AL
  42.     jz     @2
  43.  
  44.         cmp     AL, 0dh         ;convert 0d to 0d 0a
  45.         jnz     @3
  46.  
  47.         push    AX
  48.         ccall    outch
  49.         pop     AX
  50. ;        mov     DL, AL
  51. ;        mov     AX, 020ah
  52. ;        int     21h
  53.  
  54. @3:     push    AX
  55.         ccall    outch
  56.         pop     AX
  57.  
  58. ;        mov     DL, AL
  59. ;        mov     AH, 2
  60. ;        int     21h
  61.     jmp    @1
  62.  
  63. @2:    pop        si
  64.     pop        DS
  65. creturn outs
  66. cend    OUTS
  67.         end
  68.  
  69.