From 5508e775897efada888e3cf806fb56a70ec8b2fc Mon Sep 17 00:00:00 2001 From: Gregor Riepl Date: Sat, 20 Aug 2022 20:26:02 +0200 Subject: [PATCH] Add example basic prg --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e7d74bc..3725710 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The other pin mappings are as follows: | PET pin | ESP pin | Direction | Cassette 1 external | Cassette 2 internal | |----------------|---------|-----------|---------------------|----------------------| -| Cassette Write | RXD | PET->ESP | VIA PB3 | VIA PB3 (same as #1) | +| Cassette Write | RXD | PET->ESP | VIA PB3 | VIA PB3 (same as 1) | | Cassette Read | TXD | ESP->PET | PIA1 CA1 | VIA CB1 | | Cassette Motor | CTS | PET->ESP | PIA1 CB2 | VIA PB4 | | Cassette Sense | RTS | ESP->PET | PIA1 PA4 | PIA1 PA5 | @@ -87,3 +87,23 @@ Input parameters and return values for `rs_read` and `rs_write` are exchanged vi | `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) | + +## Example BASIC Program + +This program assumes that the driver is already loaded at start address $7000. + +```basic +10 PRINT "Initializing driver" +20 SYS (28672) +30 PRINT "Waiting for input" +40 SYS (28678) +50 status = PEEK(239) +60 IF status <> 0 THEN GOTO 90 +70 char = PEEK(238) +80 PRINT CHR$(char); +90 GOTO 40 +100 PRINT +110 PRINT "Disabling driver" +120 SYS (28675) +130 END +```