Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2385

development tools • Re: Building BASIC4 source

$
0
0
What's the easiest way to execute an OSBYTE call and see register A, X and Y contents afterwards?
From BASIC? Use, USR
A%=&80:PRINT USR(&FFF4)
B1040080
The Welcome Guide says "On return from the machine code section, an integer number is generated from the four registers P, Y, X, A (most significant byte to least significant byte)."

So, in the above example, P=&B1, Y=4, X=0, A=&80

EDIT: But I suspect wiser heads than mine would tell you to look at what the documentation tells you each call should return / preserve / trample on

BBC Micro User Guide https://www.stardot.org.uk/forums/viewtopic.php?t=14024
Master Reference Manuals https://www.stardot.org.uk/forums/viewtopic.php?t=20466
Advanced User Guide https://www.stardot.org.uk/forums/viewtopic.php?t=17243
Beeb Wiki https://beebwiki.mdfs.net/OSBYTE which has a nice summary of what usually happens to A, X and Y.

Statistics: Posted by james — Fri Feb 16, 2024 8:01 am



Viewing all articles
Browse latest Browse all 2385

Trending Articles