PRINT USR 5631, which registers are free to use during USR?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
1bvl109
Berk
Posts: 3
Joined: Tue Jun 04, 2019 8:00 pm

PRINT USR 5631, which registers are free to use during USR?

Post by 1bvl109 » Mon Jun 10, 2019 1:51 pm

As can be seen from https://skoolkit.ca/disassemblies/rom/asm/5615.html this simply performs a

Code: Select all

EXX
RET
in the original 48K-ROM and does all kinds of strange things.
https://skoolkit.ca/disassemblies/rom/asm/13491.html warns "For a successful return to BASIC, HL' must on exit from the machine code contain the address of the 'end-calc' instruction at 10072." Is this all there is to know? Do other registers as HL' and SP also need to be considered?
0 x
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken

User avatar
Seven.FFF
Manic Miner
Posts: 310
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: PRINT USR 5631, which registers are free to use during USR?

Post by Seven.FFF » Mon Jun 10, 2019 10:52 pm

Just SP, IY, and HL’. IY points to the BASIC sysvars, so the ROM gets very confused if you move that.
0 x
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
seven-fff.com/blog

User avatar
1bvl109
Berk
Posts: 3
Joined: Tue Jun 04, 2019 8:00 pm

Re: PRINT USR 5631, which registers are free to use during USR?

Post by 1bvl109 » Sat Jun 15, 2019 9:42 am

Thanks.
0 x
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken

Post Reply