home *** CD-ROM | disk | FTP | other *** search
- RS232TST - SIO Status Register Test
- ===================================
-
- RS232TST reads the Z80 SIO (Serial Input/Output) status register and places
- the result in the ZCPR3 user registers. After RS232TST is run, registers 0
- through 7 will contain either 0 or 1, depending on the value of the respec-
- tive bits in the status byte. The complete status byte is placed in
- register 8.
-
- RS232TST makes information about the status of the Serial I/O available to
- both ZCPR scripts (via the IF REG command) and applications (via calls to
- Z3LIB) independant of hardware configuration. A power-on script could, for
- instance, selectively run BYE, depending on whether or not a modem is
- connected to the system and turned on.
-
- Three configuration bytes in the first sector of RS232TST are clearly marked
- and may be patched with any file patch utility to permanently set several
- operating parameters as follows:
-
- PORT marks the byte selecting the port to be read by RS232TST.
-
- RESET marks a byte flag which, if set nonzero, causes a Reset External/
- Status Interrupts command to be performed prior to reading the
- status byte. This is required if the current status of the Data
- Carreir Detect and Clear To Send lines are to be correctly reported.
- On the other hand, The Interrupt Pending and Break/Abort bits are
- reset following a Reset External/Status Interrupts command, clearing
- any information which they may have contained.
-
- WHEEL If set nonzero, RS232TST is wheel protected, and will return a ZCPR3
- error code 6 if invoked, making it invisible on a secure system.
- Wheel protection status is reflected in the information presented on
- invocation with the conventional "//" self documentation request.
-
-
- THE SIO STATUS BITS
- ===================
-
- The bits in the SIO status bits reflect various conditions within and at
- the inputs of the Z80 SIO chip. These are discussed briefly below. For a
- complete discussion of the Z80 SIO 3884/5/7, consult the Mostek or Zilog
- reference manuals on the Z80 chip set.
-
- Bit 0 Recieve Character Available.
- ============================
- This bit is set when at least one character is available in the
- receive buffer. It is reset when the receive FIFO is empty.
-
- Bit 1 Interrupt Pending
- =================
- Any interrupting condition in the Z80 SIO causes this bit to be set,
- however it is readable only on SIO Channel A. This bit is used
- mainly on systems which do not have vectored interrupts, and
- eliminates the need for polling all the Channel A and B status bits
- to check for interrupt conditions.
-
- Bit 2 Transmit Buffer Empty
- =====================
- This bit is set whenever the transmit buffer becomes empty during
- asynchronous operation.
-
- Bit 3 Data Carrier Detect
- ===================
- This bit shows the state of the Data Carrier Detect input at the
- time of the last change of any of the five External/Status bits
- (DCD, CTS, Synch/Hunt or Break/Abort), and is latched until
- interrupt conditions are satisfied. The RESET flag must be set in
- RS232TST to read the current status of the DCD input line.
-
- Bit 4 Sync
- ====
- In asynchronous mode, this bit follows the inverted state of the
- ~SYNC input, and thus shows the state of this input. It is latched
- by a transition of any of the other input or condition bits (DCD,
- CTS or Bread/Abort), and thus shows the condition of the ~SYNC input
- at the time of the transition. Following a Reset External/Status
- Interrupt command, it shows the current state of the SYNC input.
- This bit must be read immediately after a Reset External/Status
- Interrupt command to read the current state of the ~SYNC input. In
- actual practice, the ~SYNC input may be tied to the Data Receive
- input.
-
- Bit 5 Clear to Send
- =============
- This bit is similar to the Data Carrier Detect. To show the true
- current status of the incoming CTS line, it must be read immediately
- after a Reset External/Status Interrupt command. Setting the RESET
- flag in RS232TST will accomplish this.
-
- Bit 6 Transmit Underrun
- =================
- This bit is not used in asynchronous communication, and is always
- set by a Reset External/Status Interrupt command.
-
- Bit 7 Break/Abort
- ===========
- In Asynchronous mode, this bit is set when a Break sequence (null
- character plus framing error) is detected in the data stream.
-
- In actual practice, only the status of bits 3 (DCD) and 5 (CTS) will be of
- concern, since these are the bits which show modem status. If, however, the
- RESET flag is set off, RS232TST may be used to read the input from any port,
- in which case, the meaning of the bits returned in the ZCPR registers will
- depend on the application.
-
- Questions, bug reports or suggestions for further development may be
- directed to:
-
- Lindsay Haisley
- 14206 Spreading Oaks Drive
- Leander, TX 78641
- 512-259-1190 Voice
- 512-259-1261 BBS (Znode 77)