home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / CCDL151L.ZIP / MSDOS / DEBUG / IO.ASM < prev    next >
Encoding:
Assembly Source File  |  1997-04-06  |  663 b   |  62 lines

  1.     .386
  2.     .model small
  3.     
  4.     public put_msg, put_pure, put_char, get_char
  5.  
  6.     extrn __pmodew:word, dos:proc
  7.     .code
  8.  
  9. dos2:
  10.     test word ptr [__pmodew],0ffh
  11.     jz dos
  12.     int 21h
  13.     ret
  14.  
  15. put_msg:
  16.     pusha
  17.     mov esi,ebx
  18. lp:
  19.     mov dl,[esi]
  20.     inc esi
  21.     or dl,dl
  22.     jz msgdone
  23.     mov ah,2
  24.     call dos2
  25.     jmp lp
  26. msgdone:
  27.     popa
  28.     ret
  29.  
  30. put_pure:
  31.     pusha
  32.     cmp dl,20h
  33.     jc  dodot
  34. testgt:
  35.     cmp dl,7fh
  36.     jc  put_char2
  37. dodot:
  38.     mov dl,'.'
  39.     jmp put_char2
  40. put_char:
  41.     pusha
  42. put_char2:
  43.     mov ah,2
  44.     call dos2
  45.     popa
  46.     ret
  47.  
  48. get_char:
  49.     push esi
  50.     push edi
  51.     push ecx
  52.     push edx
  53.     push ebx
  54.     mov ah,1
  55.     call dos2
  56.     pop ebx
  57.     pop edx
  58.     pop ecx
  59.     pop edi
  60.     pop esi
  61.     ret
  62.     end