Add example basic prg
This commit is contained in:
parent
71d7461031
commit
5508e77589
1 changed files with 21 additions and 1 deletions
22
README.md
22
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
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue