[comp.sys.apple] Quitting my own application

denbeste@bgsuvax.UUCP (William C. DenBesten) (10/01/87)

I am unable to exit a prodos application that I am writing.  When I execute
the following prodos trap, it dumps me at an applesoft prompt, rather than
putting up the default program exit routine.

	300: 20 00 bf  ; jsr MLI
	303: 65        ; quit-code
	304: 08 03     ; exit-parameters
	306: 00 00     ; if it returns, go to the monitor
	308: 04 00 00 00 00 00 00 00 00 00 00 00


I am using prodos 8 v 1.3 and prodos 1.0.1 on an enhanced //e

I have tried typing in this from the monitor, and no luck.

---
          William C. DenBesten | CSNET denbeste@research1.bgsu.edu
      Dept of Computer Science | UUCP  ...!cbosgd!osu-cis!bgsuvax!denbeste
Bowling Green State University |
  Bowling Green, OH 43403-0214 |

schumann@puff.wisc.edu (Christopher Schumann) (10/02/87)

In article <1311@bgsuvax.UUCP>, denbeste@bgsuvax.UUCP (William C. DenBesten) writes:
> 	303: 65        ; quit-code
> I am using prodos 8 v 1.3 and prodos 1.0.1 on an enhanced //e
                            ^^^                                   
I assume you have tried this on both versions of ProDOS.  I have used the quit
code with the MLI without fail.  I have never used v1.3, but I have heard that
it is buggy.  I know it works on 1.0.1.  Try issuing a CLD and CLC and maybe
even a LDA #0 before this.  Other things: Reset stack pointer; restore the
memory bitmap to a relatively clear state; make extra sure that all files
are closed.

                                                                      
Chris Schumann					schumann@puff.wisc.edu

denbeste@bgsuvax.UUCP (William C. DenBesten) (10/04/87)

> I am unable to exit a prodos application that I am writing.  When I execute
> the following prodos trap, it dumps me at an applesoft prompt, rather than
> putting up the default program exit routine.

I found the cause of my problem.  I am using edasm version 1.0.  It stores
some of its tables in the second page of the language card.  This is where
prodos stores its exit code.  Consequently, when I tried to quit, the
exit code isn't there, and has been short circuited by my assembler.  I
got really suspicious when basic.system version 1.1's bye would not work.

The end result is that I need to find a new editor.

Has apple come out with a newer version of edasm?  (This one is dated 15
Jan 84.) Is there somewhere that I can send apple // gripes to apple
on the net?  There are plenty of mac types on the net, but how about //
types?

---
          William C. DenBesten | CSNET denbeste@research1.bgsu.edu
      Dept of Computer Science | UUCP  ...!cbosgd!osu-cis!bgsuvax!denbeste
Bowling Green State University |
  Bowling Green, OH 43403-0214 |

jockc@killer.UUCP (Jock Cooper) (10/06/87)

In article <1311@bgsuvax.UUCP>, denbeste@bgsuvax.UUCP (William C. DenBesten) writes:
> I am unable to exit a prodos application that I am writing.  When I execute
> the following prodos trap, it dumps me at an applesoft prompt, rather than 
> putting up the default program exit routine.
> 
> 	300: 20 00 bf  ; jsr MLI
> 	303: 65        ; quit-code
> 	304: 08 03     ; exit-parameters

I believe that I once encountered this behavior. (It has been awhile since I
wrote 6502 assy, so bear with me).
I think I ended up calling the system death code directly.  The address 
of the system death (quit) code is stored somewhere in the ProDOS global page.
If you have a copy of Beneath Apple ProDOS (Quality Software), you can
find out the global page location that contains the quit code address and 
JMP to it.  If you don't have the book (or access to one) I will check tonight
and post the info tomorrow.


---------------------------+
jockc / ihnp4!killer!jockc |
---------------------------+