When running TR-DOS commands from within BASIC, it's necessary to prefix the command with RANDOMIZE USR 15619: REM:
first. I understand the former command, but not the latter.
For example, to load a program called "foo", this is done:
RANDOMIZE USR 15619: REM: LOAD "foo"
Instead of this:
RANDOMIZE USR 15619: LOAD "foo"
Why is this? Why is a REM
statement necessary if it's essentially a no-op? Is it used to add padding to align the memory for some reason? Is it used to waste a few t-states for timing reasons?
RANDOMIZE USR 15619
wouldn't prevent the second statement on the line from being executed. Both the RANDOMIZE and REM statements will get executed unless the TR-DOS code at address 15619 modifies the BASIC interpreter's internal state to skip over it, and apparently it doesn't do this. It appears ZX Spectrum BASIC doesn't actually tokenize its input, relying on the user into enter the tokens directly: retrocomputing.stackexchange.com/questions/5578/…PRINT USR xyz
if you wanted to see the return value, which was the contents of theBC
register. However, if you weren't bothered about that value then you would generally useRANDOMIZE
.