Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!dalcs!dalcsug!mackay
From: mackay@dalcsug.UUCP
Newsgroups: comp.sys.apple
Subject: Re: This ProDOS Quit code.
Message-ID: <217@dalcsug.UUCP>
Date: Fri, 4-Dec-87 09:45:32 EST
Article-I.D.: dalcsug.217
Posted: Fri Dec  4 09:45:32 1987
Date-Received: Sun, 6-Dec-87 22:41:04 EST
References: <8711291318.aa15019@SMOKE.BRL.ARPA> <210@dalcsug.UUCP> <871@russell.STANFORD.EDU>
Organization: Dalhousie University, Halifax, N.S., Canada
Lines: 42
Keywords: MLI,QUIT
Summary: It works perfectly!  Thanks, guys!

In article <871@russell.STANFORD.EDU>, crimmins@russell.STANFORD.EDU (Mark Crimmins) writes:
> In article <210@dalcsug.UUCP> mackay@dalcsug.UUCP (Daniel MacKay) writes:
> >...
> >How is this [the quit] 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...

William DenBesten at Bowling Green State U also sent me the solution, he
mentioned that it isn't in the ProDOS tech ref man, but IS in 
_Beneath Apple ProDOS_.  (maybe it's in the NEW version, I have one for 
ProDOS 1.0)

> 
> 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)
> ...
> Have fun,
> Mark Crimmins
> crimmins@russell.stanford.edu (arpa)
Thank you VERY much!  it works perfectly.  The FORTH code it translates 
into is:

: BYE CLOSE-ALL 4 PAR! $ 65 MLI.JSR ;

.. so it closes all open files, drops a 4 into the ProDOS parameter list
(why? they're all zeros anyway!!) and calls the MLI function hex 65.

Thank you William, and thank you Mark!
--
+---------+				Dalhousie University
|    _    |     From the		Halifax, Nova Scotia
|   (_)===|     Disk of ...		Canada
|         |      Daniel		mackay@dalcs.UUCP
+---------+			...{utai,uunet}!dalcs!dalcsug!mackay