2 ms·
Obscure facts ... On the Sinclair computers (incredibly popular in the UK, the BASIC was not written by Microsoft) it was in fact possible to predict where the
by rwmj 2y ago
Obscure facts ...
On the Sinclair computers (incredibly popular in the UK, the BASIC was not written by Microsoft) it was in fact possible to predict where the program would be loaded, so a very popular place to store machine code was in a REM statement. This also had the advantage that you could save the machine code by saving the BASIC program.
On the ZX81, the first byte of the payload of a REM statement at the beginning of the program was at address 16514, hence:
RAND USR 16514
was the command to run the machine code. (RAND set the random number seed and was just used as a convenient way to turn the USR function into a BASIC statement. The contents of the BC register were the return value from USR).
- dogline 2y agoThat's what it was! As a kid I had the TRS-80 Coco, related to the Sinclair, and I remember one of those graphing programs you typed in from Rainbow magazine, and I think it was able to plot the equation you had in a REM statement, that also had to be on a particular line number. There was a statement at the top of the program, like what you have here (maybe a POKE?), and I always knew it did something magical to be able execute from a REM statement, but I could never put it together. The Star Trader game was also really ahead of its time. There was no Google, and I've forgotten about it until just now. But, that makes sense. Thanks.