USR function

A place to discuss the ZX80's and ZX81's younger brother - the Sinclair ZX Spectrum
Post Reply
minimaltom
Posts: 9
Joined: Fri Jun 03, 2016 6:09 pm

USR function

Post by minimaltom »

Hi, I'm going through "Spectrum Machine Language for Begginers" And its going fairly well but at the beginning I was baffled by the line "don't forget that the function of "USR" is to execute a machine language subroutine", but this was the first time USR was mentioned in the book! Can someone explain what it is and why is it the value of the bc register pair at the end of running a program? I can't find anything about it with google but my guess is its a subroutine stored in ROM/RAM??? that executes Machine code instructions.

Thanks
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: USR function

Post by 1024MAK »

Have a read here ;)

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: USR function

Post by XavSnap »

Hi,
Just a keyboard trouble !
Don't type URS as U_S_R word.
If you type "U" "S" "R", this word is a variable, not a function!

10 LET USR=1
20 PRINT USR
RUN
1
:oops:
30 RANDOMIZE USR =>> RANDOMZE 1
40 LET VAL=USR 32000 =>> VAL= 1 32000 (RETURN AN ERROR!)

You had to type "1" "0" "T" "CTRL+SHIFT" "L" "3" "2" "0" "0" "0" !
>> 10 RANDOMIZE USR 32000
Attachments
Sp1.jpg
Sp1.jpg (183.65 KiB) Viewed 4062 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply