[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BYE Location
Edhel Iaur, Esq. wrote:
> What is the hex location of ProDOS's BYE code? Is it possible to use
> it from the Monitor to escape from some P8 crashes so that I can get
> into GS/OS again? Maybe by entering a tiny machine language routine
> to switch to the language card & call the BYE thing?
The BYE code in P8 is in the second bank of bank-switched memory between $D100
and $D3FF, but must be copied to location $1000 before being launched. Instead of
trying to launch it directly and screwing with all the bank-switching necessary,
I've found it's WAY easier to just call the P8 MLI QUIT command and let P8 do all
the work (assuming it's still in memory and stable).
I use this snippit of code from a monitor prompt(*):
*300:20 00 BF 65 09 03 4C 58 FF 04 00 00 00 00 00 00 N 300G
Which translates to:
300: JSR MLI
DFB $65 ;Quit command
ADR $309 ;Address of parameter table
JMP $FF58 ;Drop back to monitor if there's an error
309: DFB $04 ;The number of parameters (4, fixed)
DFB $00 ;Parm 1
ADR $0000 ;Parm 2
DFB $00 ;Parm 3
ADR $0000 ;Parm 4
N (normal, just a separator)
300G (go!)
The JSR to MLI calls the P8 Machine Language Interface with a command of QUIT
($65), and passes the parameters at location $309. If there's an error, I just jump
back to a monitor prompt. The parameter table is fixed with 4 dummy parameters with
values of 0, and has never changed that I know of.
This code works great on an Apple ][+, //e or //c under P8 and it SHOULD work
just fine on a IIgs as well (never really had a chance to check it).
By the way, all the information I needed to create this little code chunk, along
with virtually anything you could want to know about P8 (at least the early
versions), can be found in the book "Apple ProDOS: Advanced Features for
Programmers" by Gary B. Little. This book is worth its weight in gold, easily.
Anything else? :)
--
James Noyes
(jnoyes@quality.NOSPAM.net)
Remove the NOSPAM before replying!
"Thank you for abusing AT&T."
- References:
- BYE Location
- From: LOSETHECAPITALWORDSedhel@bigfoot.com (Edhel Iaur, Esq.)