2 ms·
"I've no idea how Sinclair Basic stored them, but BBC Basic used a hash table that was immediately after the end of your program." I expected that Sinclair Bas
by Someone 12y ago
"I've no idea how Sinclair Basic stored them, but BBC Basic used a hash table that was immediately after the end of your program."
I expected that Sinclair Basic would have a rule that variable names have one significant character, and reserved space for 26 integers A% through Z%, 26 strings A$ through Z$, and forget about floating point, but reading http://www.worldofspectrum.org/ZX81BasicProgramming/chap06.html http://www.worldofspectrum.org/ZX81BasicProgramming/chap06.h..., that isn't true; this language even allowed spaces in identifiers.
At the same time, we have (same link):
"You will get a report 2/0, & looking up 2 in appendix B, you will see that it means 'variable not found',
So. This enormous 8kB ROM wasn't large enough to hold error messages.
And, reading http://www.cs.columbia.edu/~%20sedwards/classes/2006/w4115-fall/reports/zx81basic.pdf http://www.cs.columbia.edu/~%20sedwards/classes/2006/w4115-f..., it seems that loop and stir g variables had to be single-letter (yes, your program had at most 26 strings. Not that much of a limit if you have a few hundred bytes of RAM for your program and your data)
That PDF also gives some more limitations of the language, claiming that it wouldn't do complex expressions such as
10 let a = 2 * a + 1
- david-given 12y agoEverything you never wanted to know about ZX81 Basic's memory layout! http://www.worldofspectrum.org/ZX81BasicProgramming/chap27.html http://www.worldofspectrum.org/ZX81BasicProgramming/chap27.h... ...wow. The framebuffer is between the program and the variables? And as the program changes size, and the screen changes size, it relocates everything above there? No wonder editing lines in a big program is so slow... Also, that mention of the calculator stack? That's used by an embedded Forth-like language used to do floating point operations; which is why Sinclair Basic's trig functions are so appalling.