Skip to content

Commit 05d66b2

Browse files
committed
Create single-entry table of maximum bytes in tokenized .BA
1 parent 3e1159d commit 05d66b2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

degenerate/lorem/REAME.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Largest BASIC programs
2+
3+
To experimentally discover the size of the largest possible tokenized
4+
BASIC program on a Model T computer, use a host computer to send a
5+
program line-by-line over the serial port to be tokenized.
6+
7+
* On Tandy 200:
8+
```BASIC
9+
?fre(0)
10+
19334
11+
load "com:98n1enn"
12+
```
13+
* On UNIX host:
14+
```bash
15+
$ stty -F /dev/ttyUSB0 icanon ixon ixoff stop ^S start ^Q susp undef eof ^Z
16+
$ stty -F /dev/ttyUSB0 onlcr icrnl -echo 19200 pass8 -cstopb
17+
$ ./lorem.sh 19214 > /dev/ttyUSB0 && echo -n $'\cZ' >/dev/ttyUSB0
18+
```
19+
20+
On a Tandy 200, with the default of 19334 bytes free, a BASIC program
21+
of <= 19214 bytes works, but >= 19215 gives an `?OM Error`. It
22+
seems **120 bytes** are needed to parse a line of BASIC.
23+
24+
Note that after loading such a program, commands like `?fre(0)` and
25+
`clear` will die with an out of memory error. In fact, while the
26+
program can be `RUN` after loading it over the serial port, even just
27+
`SAVE`ing the program will cause it to fail to RUN with an `?OM Error`!
28+
29+
Running `CLEAR 136` (which frees 120 characters compared to the
30+
default of 256) gives 19454 bytes free on a Tandy 200. The maximum
31+
lorem BASIC program then becomes 19454 - 120 = 19334 bytes.
32+
33+
The maximum possible filesize can be achieved by running `CLEAR 0`,
34+
which on the Tandy 200 gives 19590 bytes free. Again, the maximum
35+
lorem BASIC program I'm able to transmit is 19590 - 120 = 19470 bytes.
36+
Of course, with zero bytes of string space reserved, no useful program
37+
can be run.
38+
39+
| Model | Max Bytes Free | Max tokenized BASIC filesize |
40+
|-----------|----------------|------------------------------|
41+
| Model 100 | | |
42+
| Tandy 200 | 19,588 | 19,470 |
43+
| Tandy 102 | | |

0 commit comments

Comments
 (0)