Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Register parameters

Code Block
languagenone
titleRST 20H, DEFW DEFB $8D
NIN:
     L = reason code
     Other register parameters depend on reason code
OUT:
     Depends on reason code, see below.
     IX will always be unchanged. 

...

Full details of this call's reason codes are found below. This interface is used by OZ internally, and don't work on application level. For Application level serial port I/O, use GN_Opf to get serial port handle and use OS_Gb / OS_Pb to transmit data. Applications might use OS_Si to reset serial port buffers, and interact with the Panel. Block transfer is implemented since OZ version 4.5.

Other information of this call can be found in the The Serial Interface section.

SI_HRD

Code Block
titleSI_HRD (L = $00), Serial hard reset
IN:  -
OUT: Fc = 0

Registers changed after return:
     ..BCDEHL/IXIY same
     AF....../.... different

...

This call should be useful to install new panel settings or when starting low level (ie. using SI_GBT, SI_PBT etc.) serial operations. It carries out the following: 

1. Empty receive and transmit buffers.
2. Reset the XON/XOFF flags.
3. Reset baud rates, parity and flow control settings to the PANEL values.
4. Assert RTS.
5. Resets the serial port timeout to its default of 10 minutes. 


SI_INT

Code Block
titleSI_INT (L = $06), interrupt entry point

...

IN:  -
OUT: -

Registers changed after return:
     AFBCDEHL/IXIY same
     ......../.... different

Internal operating system usage only.
This call is used by the serial port driver to send XOFF when software handshaking is active. 


SI_GBT

Code Block
languagenone
titleSI_GBT (L = $09), get byte from serial port
IN:  BC = timeout in centiseconds

Out if call succeeded:
     Fc = 0
     A = byte received
     BC = remaining time
Out if call failed:
     Fc = 1
     A = RC_TIME ($02) (if no data available before timeout)

Registers changed after return:
     ....DE../IXIY same
     AFBC..HL/.... different

...

A slot, in this context, is the set of bits required to transmit on character. This will include 8 data bits plus start and stop bits.


SI_FTX

Code Block
languagenone
titleSI_FTX (L = $12), Flush transmit buffer
IN:  -
OUT: Fc = 0

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different


SI_FRX

Code Block
languagenone
titleSI_FRX (L = $15), Flush receive buffer
IN:  -
OUT: Fc = 0

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different


SI_TMO

Code Block
languagenone
titleSI_TMO (L = $18), set default timeout
IN:  BC = new value for default timeout
OUT: Fc = 0

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different

If you set the default to $FFFF then when the default is used (by setting a timeout value of $FFFF in get and put byte routines) then the system will wait forever. A soft reset sets the default timeout to 10 minutes. This timeout is completely independent of the system timeout, which is set by the Panel.


SI_GX

Code Block
titleSI_GX (L = $1B), get multiple bytes from serial port, using default timeout (OZ 4.5)
IN:  
      BC = number of byte to get from serial port, maximum 16384, one bank
      DE = destination
          DE = 0, write bytes to a file opened with its handle in IX 
          DE > 0, write bytes to memory at (DE)
      IX = file handle (if DE = 0)


Out if call succeeded:
      Fc = 0
      BC = remaining time (SI_TMO)
      DE = points at last byte fetched + 1 (if DE(IN) > 0)


Out if call failed:
 Fc = 1
      A = RC_TIME, timeout elapsed
      A = RC_EOF, end of file reached
      A = RC_WP, input device is read protected
 
      BC = number of bytes not read


Registers changed after return:
      ......../IXIY same
      AFBCDEHL/.... different


SI_PX

Code Block
titleSI_PX (L = $1E), put multiple bytes to serial port, using default timeout (OZ 4.5)
IN:  
      BC = number of byte to write to serial port, maximum 16384, one bank
      DE = input
          DE = 0, input is a file/device opened with its handle in IX 
          DE > 0, input is memory at (DE)
      IX = file handle (if DE = 0)

Out if call succeeded:
      Fc = 0
      BC = remaining time (SI_TMO)
 
Out if call failed:
      Fc = 1
      A = RC_TIME, timeout elapsed
      A = RC_EOF, end of file reached
      A = RC_RP, input device is read protected

      BC = number of bytes not written

Registers changed after return:
      ......../IXIY same
      AFBCDEHL/.... different


SI_GXT

Code Block
titleSI_GXT (L = $21), get multiple bytes until ESC <x> terminator, using default timeout (SI_TMO)
IN:  
      BC = number of byte to get from serial port, maximum 16384, one bank
      DE = destination
          DE = 0, write bytes to a file opened with its handle in IX 
          DE > 0, write bytes to memory at (DE)
      IX = file handle (if DE = 0)


Out if call succeeded, Fc = 0:
       Fz = 1,
               BC <> 0, A = ESC terminator encountered, number of bytes not read
       Fz = 0,
               A = FFh
               BC = 0, all bytes read, no terminator encountered
       DE = points at last byte fetched + 1 (if DE(in) > 0)


Out if call failed:
 Fc = 1
      A = RC_TIME, timeout elapsed
      A = RC_EOF, end of file reached
      A = RC_WP, input device is read protected
 
      BC = number of bytes not read


Registers changed after return:
      ......../IXIY same
      AFBCDEHL/.... different