home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / asm_kit / stdiolib.asm < prev    next >
Assembly Source File  |  1985-06-21  |  3KB  |  154 lines

  1. ; I/O MODULE FILE STDIO.ASM
  2. ;------------------- CODE AREA STARTS --------------------------
  3. ;
  4. codes          segment
  5. ;
  6. ;+++++++++++++++++ PUBLIC DECLARATIONS START +++++++++++++++++++
  7. ;
  8. public          stdin,stdinne,stdinck,stdout,stdoutdr,stdcrlf
  9. public          stdspace,stdmessout
  10. ;
  11. ;+++++++++++++++++ PUBLIC DECLARATIONS END +++++++++++++++++++++
  12. ;
  13. assume          cs:codes
  14. ;
  15. ;--------------------- routine begins --------------------------
  16. ;
  17. ;ROUTINE FOR STANDARD INPUT WITH ECHO
  18. ;
  19. stdin          proc far
  20.           mov  ah,1
  21.           int  21h
  22.           ret
  23. stdin          endp
  24. ;
  25. ;----------------------    routine    ends ---------------------------
  26. ;
  27. ;--------------------- routine begins --------------------------
  28. ;
  29. ;ROUTINE FOR STANDARD INPUT WITHOUT ECHO
  30. ;
  31. stdinne          proc far
  32.           mov  ah,8
  33.           int  21h
  34.           ret
  35. stdinne          endp
  36. ;
  37. ;----------------------    routine    ends ---------------------------
  38. ;
  39. ;--------------------- routine begins --------------------------
  40. ;
  41. ;ROUTINE TO CHECK FOR STANDARD INPUT
  42. ;
  43. stdinck          proc far
  44.           push dx
  45.           mov  dl,0FFh
  46.           mov  ah,06h
  47.           int  21h
  48.           pop  dx
  49.           ret
  50. stdinck          endp
  51. ;
  52. ;----------------------    routine    ends ---------------------------
  53. ;
  54. ;--------------------- routine begins --------------------------
  55. ;
  56. ;ROUTINE FOR STANDARD OUTPUT
  57. ;
  58. stdout          proc far
  59.           push dx
  60.           mov  dl,al
  61.           mov  ah,2
  62.           int  21h
  63.           pop  dx
  64.           ret
  65. stdout          endp
  66. ;
  67. ;----------------------    routine    ends ---------------------------
  68. ;
  69. ;--------------------- routine begins --------------------------
  70. ;
  71. ;ROUTINE FOR DIRECT CONSOLE OUTPUT
  72. ;
  73. stdoutdr      proc far
  74.           push dx
  75. ;
  76.           cmp  al,0FFh
  77.           je   stdoutdrexit
  78.           mov  dl,al
  79.           mov  ah,6
  80.           int  21h
  81. ;
  82. stdoutdrexit:
  83.           pop  dx
  84.           ret
  85. stdoutdr      endp
  86. ;
  87. ;----------------------    routine    ends ---------------------------
  88. ;
  89. ;--------------------- routine begins --------------------------
  90. ;
  91. ;ROUTINE TO SEND CR LF TO STANDARD OUTPUT
  92. ;
  93. stdcrlf          proc far
  94.           push ax
  95. ;
  96.           mov  al,13
  97.           call stdout
  98.           mov  al,10
  99.           call stdout
  100. ;
  101.           pop  ax
  102.           ret
  103. stdcrlf          endp
  104. ;
  105. ;----------------------    routine    ends ---------------------------
  106. ;
  107. ;--------------------- routine begins --------------------------
  108. ;
  109. ;ROUTINE TO SEND SPACE TO STANDARD OUTPUT
  110. ;
  111. ;A space is sent to the    standard outout    device
  112. ;
  113. stdspace      proc far
  114.           push ax
  115. ;
  116.           mov  al,32
  117.           call stdout
  118. ;
  119.           pop  ax
  120.           ret
  121. stdspace      endp
  122. ;
  123. ;----------------------    routine    ends ---------------------------
  124. ;
  125. ;--------------------- routine begins --------------------------
  126. ;
  127. ;ROUTINE TO SEND MESSAGE TO STANDARD OUTPUT
  128. ;
  129. stdmessout    proc far
  130.           push si
  131.           push ax
  132. ;
  133. stdmessout1:
  134.           mov  al,[si]
  135.           inc  si
  136.           cmp  al,0
  137.           je   stdmessoutexit
  138.           call stdout
  139.           jmp  stdmessout1
  140. ;
  141. stdmessoutexit:
  142.           pop  ax
  143.           pop  si
  144.           ret
  145. stdmessout    endp
  146. ;
  147. ;----------------------    routine    ends ---------------------------
  148. ;
  149. codes          ends
  150. ;
  151. ;--------------------- code area ends --------------------------
  152.           end
  153. ;---------------------------------------------------------------
  154.