Describe driver interface in readme

This commit is contained in:
Gregor Riepl 2022-08-20 18:29:20 +02:00
parent c5a211a8f0
commit c9bc6b9207

View file

@ -62,3 +62,26 @@ L |_| |_| |___|
| | | | | |
-3 _| |___| |___| |____
S 1 1 0 1 1 0 0 1 E
## PET RS232 Driver
On the software side, the RS-232 interface is realized as a loadable driver for
the PET. It can be compiled for loading into RAM, or for flashing onto a
ROM chip.
The driver defines four entry points:
| Function | Entry point (load at $7000) | Description |
|-------------|-----------------------------|-------------|
| `rs_init` | $7000 | Initialize the driver and the hardware |
| `rs_uninit` | $7003 | Disable the hardware interface |
| `rs_read` | $7006 | Read one byte from the input buffer |
| `rs_write` | $7009 | Write one byte to the output buffer |
Input parameters and return values for `rs_read` and `rs_write` are exchanged via the zero page:
| Variable | Address | Description |
|----------------|---------|-------------|
| `rs_available` | $ed | Available bytes to read or write (size of the input buffer or remaining space in output buffer) |
| `rs_data` | $ee | Data byte (return from read or parameter for write) |
| `rs_status` | $ef | Status of the operation (0=ok, 1=read buffer empty, 2=write buffer full, 3=not initialized, 4=already initialized) |