4 ms·
>an early 1200 baud modem...needed a USR() what's a USR()? asking cuz USRobotics was a modem company
by fsckboy 2y ago
>an early 1200 baud modem...needed a USR()
what's a USR()?
asking cuz USRobotics was a modem company
- compressedgas 2y ago> USR is a BASIC function to call (execute) a machine code routine
- sokoloff 2y agoThis. I'll add the following reference in case someone is curious and wants more details: https://www.page6.org/archive/issue_11/page_24.htm https://www.page6.org/archive/issue_11/page_24.htm One of the annoying things is that the most convenient way to encode a short machine code subroutine was in a BASIC string. But BASIC strings are not loaded in a predictable location in RAM, so any code intended to be encoded in a BASIC string has to be relocatable (using only relative branches/jumps). That's not an issue for a simple XMODEM checksum calculation, of course.
- rwmj 2y agoObscure 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.
- renewedrebecca 2y agoUsr() is a way to call out to a machine (assembly) language subroutine from BASIC.