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 5:09 pm

USR function

Post by minimaltom » Sun Jun 12, 2016 3:00 pm

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: 1773
Joined: Mon Sep 26, 2011 9:56 am
Location: Looking forward to summer in Somerset, UK...

Re: USR function

Post by 1024MAK » Sun Jun 12, 2016 4:30 pm

Have a read here ;)

Mark

User avatar
XavSnap
Posts: 461
Joined: Sat May 10, 2008 3:23 pm

Re: USR function

Post by XavSnap » Mon Jun 13, 2016 6:32 pm

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 274 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest