Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!sri-unix!ctnews!pyramid!decwrl!labrea!russell!crimmins
From: crimmins@russell.STANFORD.EDU (Mark Crimmins)
Newsgroups: comp.sys.apple
Subject: Re: This ProDOS Quit code.
Message-ID: <871@russell.STANFORD.EDU>
Date: Wed, 2-Dec-87 02:59:08 EST
Article-I.D.: russell.871
Posted: Wed Dec  2 02:59:08 1987
Date-Received: Sat, 5-Dec-87 14:33:57 EST
References: <8711291318.aa15019@SMOKE.BRL.ARPA> <210@dalcsug.UUCP>
Reply-To: crimmins@russell.UUCP (Mark Crimmins)
Organization: Center for the Study of Language and Information, Stanford U.
Lines: 42
Keywords: MLI,QUIT
Summary: Here's how to QUIT with MLI

In article <210@dalcsug.UUCP> mackay@dalcsug.UUCP (Daniel MacKay) writes:
>A friend wrote a FORTH under ProDOS 8 and hooked up most of the MLI functions.
>However, one thing I have with all the other applications I use, is a 
>way to Quit, back to whatever program launched it (I use Mousedesk by
>the now defunct VersionSoft).  
>
>The ProDOS tech ref man (the version I have came with ProDOS 1.0)
>doesn't mention anything about this- in fact, it says that you have
>to write code that asks the user what application they want to quit
>to- this is rediculous because it's obvious that AppleWriter, Works,
>Access //, Ascii Express, AppleSloth (the new version) all do this
>automatically.
>
>How is this managed?   Who remembers the calling program's directory
>and system file name?  What's the MLI call if it is one, or how's it done
>otherwise?  Thanks a lot, guys!

Not in the ProDOS manual?  I kinda doubt that, but...

Here's the generic way to quit from ProDOS:

       jsr $BF00	;MLI address
      .BYTE $65   	;or dfb $65, or whatever
		        ;$65 is the MLI QUIT code
      .WORD qtprms      ;address of a parmeter table (lsb first)

qtprms: .BYTE $04,$00,$00,$00,$00,$00,$00   ;(or dfb, or whatever)

That's it; it'll send you to whatever code is installed in the ProDos
selector area.

In case my assembler jargon is not clear, here's the monitor commands
to install a quit command at $1000:

1000:20 00 BF 65 06 10
1006:04 00 00 00 00 00 00

Try doing that, and a 1000g will send you to your selector.

Have fun,
Mark Crimmins
crimmins@russell.stanford.edu (arpa)