Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!mattd
From: mattd@Apple.COM (Matt Deatherage)
Newsgroups: comp.sys.apple
Subject: Re: ProDOS "BYE" & Byrd's Better Bye
Summary: Don't do this unless you like pain
Message-ID: <33904@apple.Apple.COM>
Date: 10 Aug 89 17:41:51 GMT
References: <8908100542.AA01553@uxa.cso.uiuc.edu> <2918@puff.cs.wisc.edu>
Organization: Apple Computer Inc, Cupertino, CA
Lines: 84

In article <2918@puff.cs.wisc.edu> wilson@cat23.CS.WISC.EDU (David Wilson) writes:
>
>About the BYE program in ProDOS... to get Byrd's Better Bye installed
>is a pretty easy task...
>
>	1) Take your copy of ProDOS with BBB 
>	   and load it into memory starting at $2000.
>
>	   ]BLOAD PRODOS,A$2000,TSYS
>
>	2) Move the "Bye" code from ProDOS to where it would go if
>	   the ProDOS quit call were activated. (The "Bye" code
>	   resides in Bank 2 of the Bank Switched memory at 
>	   $D100-$D3FF and is moved down to $1000 when it is actually
>	   run.)
>
>	   ]CALL-151
>	   *1000
>	3) Save the code to disk...
>
>	   *BSAVE BBB.QUIT,A$2000,L$2FF
>

So far, so good (except it was written by Alan Bird, not "Byrd").

>	4) Now load the ProDOS that you want to have a "Better Bye" 
>	   from a different disk (assumed to be in Drive 1 in Slot 5).
>
>	   *PREFIX,S5
>	   *BLOAD PRODOS,A$2000,TSYS
>
>	5) Take the program code you have moved down to $1000
>	   and insert it into the ProDOS file before saving.
>
>	   *5900<1000.12FFM
>	   *BSAVE PRODOS,A$2000,L15485 <--- this length will change
>					    with ProDOS versions...
>					    Check length before-hand.
>

ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK
ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK
ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK ACK

A)  You may NEVER just *assume* where something is going to be in the file
PRODOS.  You have to boot with that version of ProDOS, look at the quit code
at $D100 and then find it in the file.  For example, in P8 1.8 you'll find
the quit code is *NOT* at offset $3900 ($5900 when BLOADed), and anyone
following the above procedure with P8 1.8 will kill their ProDOS 8 file.

B)  You may also NEVER assume that nothing follows the Quit code in the
PRODOS file.  If the quit code is less than three pages long on disk, the above
procedure will kill anything in the file after it, again making the file
unusable.

All in all, for many future compatibilty reasons, it's *always* better to
leave the file PRODOS (or P8) alone and run a disk-based program selector
that installs itself in memory.  Takes a second or so longer at boot time but
avoids a lot of problems in the future.

>	6) Try it out...
>
No, Don't try it.  Unless you like destroying P8 and hoping it doesn't destroy
your disks in retaliation.

>-------------------------------------------------------------------------------
>| Dave Wilson                      "Real Programmers never WRITE code ever,...|
>| wilson@garfield.cs.wisc.edu       they always compose at the terminal       |
>| wilson@macc.wisc.edu              and they NEVER use the backspace key!"    |
>|									      |
>| I'm a Senior and I'll be one forever if I don't get rid of this damned      |
>| Computer...                                                                 |
>-------------------------------------------------------------------------------

-----------------------------------------------------------------------------
Matt Deatherage, Apple Computer, Inc. | "The opinions expressed in this tome
Send PERSONAL mail ONLY (please) to:  | should not be construed to imply that
AppleLink PE: Matt DTS  GEnie: AIIDTS | Apple Computer, Inc., or any of its
CompuServe: 76703,3030                | subsidiaries, in whole or in part,
Usenet:  mattd@apple.com              | have any opinion on any subject."
UUCP:  (other stuff)!ames!apple!mattd | "So there."
-----------------------------------------------------------------------------