From c9bc6b9207dfd068f0e30f7974eb172954b19b36 Mon Sep 17 00:00:00 2001 From: Gregor Riepl Date: Sat, 20 Aug 2022 18:29:20 +0200 Subject: [PATCH] Describe driver interface in readme --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 411da54..df0c014 100644 --- a/README.md +++ b/README.md @@ -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) |