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
Dizzy
Posts: 98
Joined: Tue Jun 04, 2019 9:00 pm

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

Post by 1bvl109 »

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?
"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: 736
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 »

Just SP, IY, and HL’. IY points to the BASIC sysvars, so the ROM gets very confused if you move that.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
1bvl109
Dizzy
Posts: 98
Joined: Tue Jun 04, 2019 9:00 pm

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

Post by 1bvl109 »

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