Path: news1.icaen!news.uiowa.edu!uunet!in3.uu.net!206.154.70.8!news.webspan.net!feed1.news.erols.com!news-peer.sprintlink.net!news-pull.sprintlink.net!news-in-east.sprintlink.net!news.sprintlink.net!Sprint!206.246.32.14!news.vr1.com!not-for-mail From: James Noyes Newsgroups: comp.sys.apple2 Subject: Re: BYE Location Date: Fri, 20 Jun 1997 16:53:59 -0600 Organization: Apple // Forever!! Lines: 52 Message-ID: <33AB0A07.3362@quality.NOSPAM.net> References: <33aaf1d3.5804222@167.152.149.11> NNTP-Posting-Host: broadway.vr1.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.02 (X11; I; SunOS 5.5.1 sun4u) 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."