home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / bluebook.zip / STDIO.DOC < prev    next >
Text File  |  1986-05-08  |  9KB  |  235 lines

  1. STDIO.DOC -- Description of the I/O procedures in STDIO.ASM
  2. ===========================================================
  3.  
  4.   From `BLUEBOOK of ASSEMBLY ROUTINES for the IBM PC & XT'
  5.         by Christopher L. Morgan
  6.         Copyright (C) 1984 by The Waite Group, Inc.
  7.  
  8.   Purpose: These routines perform fundamental input/output functions for the
  9.     keyboard, screen, and communication lines.  The standard I/O routines
  10.     can be redirected.  The communications routines alleviate some of the
  11.     problems encountered in DOS and BIOS serial communications handling.
  12.  
  13.    Contains:
  14.    ---------
  15.    COM_INCK    --  Communications line check
  16.    COM_INIT    --  Initialize communications line
  17.    COM_OFF    --  Communications line off
  18.    COM_ON    --  Communications line on
  19.    COM_OUT    --  Communications line output
  20.    STD_CRLF    --  Standard output with carriage return & linefeed
  21.    STD_IN    --  Standard input with echo
  22.    STD_INCK    --  Standard input check
  23.    STD_INNE    --  Standard input with no echo
  24.    STD_MSGOUT    --  Standard output of a message
  25.    STD_OUT    --  Standard output
  26.    STD_OUTDR    --  Direct standard output
  27.    STD_SPACE    --  Standard output of a space    
  28. _______________________________________________________________________________
  29.  
  30. STD_IN -- Standard Input with Echo
  31. ---------------------------------
  32.   Function: This routine accepts input from the standard I/O device. 
  33.  
  34.   Input: This routine waits for one character code from the std input device.
  35.  
  36.   Output: ASCII codes are returned in the AL register.  Each character is
  37.     echoed out the standard output device as it is input through the standard
  38.     input device.
  39.  
  40.   Registers used: AH is modified; AL is used for output.
  41.  
  42.   Routines called: DOS call #1 (Keyboard input) is used.
  43. _______________________________________________________________________________
  44.  
  45. STD_INNE -- Standard Input with No Echo
  46. --------------------------------------
  47.   Function: This routine accepts input from the standard I/O device. No echo
  48.     is generated.
  49.  
  50.   Input: This routine waits for one character code from the std input device.
  51.  
  52.   Output: ASCII codes are returned in the AL register.
  53.  
  54.   Registers used: AH is modified; AL is used for output
  55.  
  56.   Routines called: DOS call #8 (Console output without echo) is used.
  57. _______________________________________________________________________________
  58.  
  59. STD_INCK -- Standard Input Check
  60. -------------------------------
  61.   Function: This routine checks, but does not wait for input from the standard
  62.     input device.
  63.  
  64.   Input: Input is from the standard I/O device.  No check is made for ^-Break.
  65.  
  66.   Output: If a character is available, the routine returns with the flag
  67.     condition NZ and a character in AL.  If no character is available, then
  68.     the routine returns with the flag condition Z, and AL is garbage. No echo
  69.     is generated for the input characters.    
  70.  
  71.   Registers used: AH is modified; AL is used for output.
  72.  
  73.   Routines called: DOS call #6 (Direct console I/O) is used.
  74. _______________________________________________________________________________
  75.  
  76. STD_OUT -- Standard Output
  77. -------------------------
  78.   Function: This routine sends individual characters out the std output device.
  79.  
  80.   Input: Upon entry, an ASCII code is in AL.
  81.  
  82.   Output: A single character is output through the standard output device.
  83.  
  84.   Registers used: AH is modified; AL is used for input.
  85.  
  86.   Routines called: DOS call #2 (Display output) is used.
  87. _______________________________________________________________________________
  88.  
  89. STD_OUTDR -- Direct Standard Output
  90. ----------------------------------
  91.   Function: This routine sends individual characters out the standard output
  92.     device, using direct output.
  93.  
  94.   Input: Upon entry, an ASCII code is in AL.
  95.  
  96.   Output: A single character is output through the direct standard output call.
  97.  
  98.   Registers used: AH is modified; AL is used for input.
  99.  
  100.   Routines called: DOS call #6 (Direct console I/O) is used.
  101. _______________________________________________________________________________
  102.  
  103. STD_CRLF -- Standard Output of a Carriage Return/Linefeed Sequence
  104. -----------------------------------------------------------------
  105.   Function: This routine sends a <CR> and then a <LF> to the std output device.
  106.  
  107.   Input: None
  108.  
  109.   Output: ASCII code 13 for <CR> and ASCII code 10 for <LF> are sent to the
  110.     standard output device.
  111.  
  112.   Registers used: AX is first saved and then restored.
  113.  
  114.   Routines called: STD_OUT
  115. _______________________________________________________________________________
  116.  
  117. SDTSPACE -- Standard Output of a Space
  118. --------------------------------------
  119.   Function: This routine sends a space out through the standard output device.
  120.  
  121.   Input: None
  122.  
  123.   Output: ASCII code 32 for a space is sent to the standard output device.
  124.  
  125.   Registers used: AX is first saved and then restored.
  126.  
  127.   Routines called: STD_OUT
  128. _______________________________________________________________________________
  129.  
  130. STD_MESSOUT -- Standard Output of a Message
  131. ------------------------------------------
  132.   Function: This routine sends a message out through the std output device.
  133.  
  134.   Input: Upon input, DS:SI points to the message.  The message must terminate
  135.          with an ASCII code 0.
  136.  
  137.   Output: The individual characters of the message are output through the 
  138.     standard output device.
  139.  
  140.   Registers used: AX is first saved and then restored; SI is used to point to
  141.     the input.
  142.  
  143.   Segments referenced: The data segment must contain the message.
  144.  
  145.   Routines called: STD_OUT
  146. _______________________________________________________________________________
  147.  
  148. COM_INIT -- Initialize Communications Line
  149. -----------------------------------------
  150.   Function: This routine initializes one of the two communications lines.
  151.  
  152.   Input: Upon entry, AL contains the initialization byte as follows:
  153.  
  154. bit ---- 7  6  5 ---------- 4  3 ------------ 2 -------------- 1     0 ---- bit
  155.         ---------          ------          --------          -----------   
  156.     baud rate          parity          stop bit          word length 
  157.         ==========        =========        ========          ===========    
  158.           000 =  110         00 = none           0 = 1            10 = 7 bits
  159.         001 =  150        01 = odd          1 = 2            11 = 8 bits
  160.         010 =  300        10 = none      
  161.         011 =  600        11 = even
  162.         100 = 1200        
  163.         101 = 2400       
  164.         110 = 4800
  165.         111 = 9600
  166.                           DX contains the unit number (0=COM_1:, 1=COM_2:). 
  167.  
  168.   Output: Output is sent to the hardware controlling the specified com line.
  169.  
  170.   Registers used: None
  171.  
  172.   Routines called: BIOS interrupt 14H (RS-232 I/O) is used.
  173. _______________________________________________________________________________
  174.  
  175. COM_INCK -- Communications Line Input Check
  176. ------------------------------------------
  177.   Function: This routine checks, but does not wait for input from one of the
  178.     two serial communications lines.
  179.  
  180.   Input: Upon entry, DX contains the unit number (0=COM_1:, 1=COM_2:).  During
  181.     the routine, input is from the specified communications line.
  182.  
  183.   Output: If a byte is available, the routine returns with the flag condition
  184.     NZ and the byte in AL.  If no byte is available, the routine returns with
  185.     the flag condition Z, and AL is garbage.
  186.  
  187.   Registers used: AH is modified; DX is used for input & AL is used for output.
  188.  
  189.   Segments referenced: The system data segment is referenced.
  190. _______________________________________________________________________________
  191.  
  192. COM_OUT -- Communications Line Output
  193. ------------------------------------
  194.   Function: This routine sends a byte out one of the two communications lines.
  195.  
  196.   Input: Upon entry, AL contains the byte to be sent out and DX contains the
  197.     specified unit number (0=COM_1:, 1=COM_2:).
  198.  
  199.   Output: Output is sent to the specified communications line.
  200.  
  201.   Registers used: None.
  202.  
  203.   Routines called: BIOS interrupt 14H (RS-232 I/O) is used.
  204. _______________________________________________________________________________
  205.  
  206. COM_ON -- Communications Line On
  207. -------------------------------
  208.   Function: This routine turns on the handshaking signal, DTR(line 20), and
  209.     RTS (line 4) on the specified communications line
  210.  
  211.   Input: Upon entry, DX contains the unit number (0=COM_1:,1=COM_2:).
  212.  
  213.   Output: Just to the communications line
  214.  
  215.   Registers used: DX is used for input; no registers are modified.
  216.  
  217.   Segments referenced: The system data segment is referenced.
  218. _______________________________________________________________________________
  219.  
  220. COM_OFF -- Communications Line Off
  221. ---------------------------------
  222.   Function: This routine turns off the handshaking signal, DTR(line 20), on
  223.     the specified communications line.  RTS(line 4) is kept on as it was.
  224.  
  225.   Input: Upon entry, DX contains the unit number (0=COM_1:,1=COM_2:).
  226.  
  227.   Output: Just to the communications line
  228.  
  229.   Registers used: DX is used for input; no registers are modified.
  230.  
  231.   Segments referenced: The system data segment is referenced.
  232. _______________________________________________________________________________
  233. >>>>> Physical EOF STDIO.DOC <<<<<        
  234.         
  235.