Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!mips!apple!mattd From: mattd@Apple.COM (Matt Deatherage) Newsgroups: comp.sys.apple Subject: Re: Error reporting under Prodos 8. Message-ID: <38729@apple.Apple.COM> Date: 18 Feb 90 20:14:57 GMT References: <8190@wpi.wpi.edu> <15800070@ux1.cso.uiuc.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 49 In article <15800070@ux1.cso.uiuc.edu> cs225af@ux1.cso.uiuc.edu writes: > > >If you just need to send an error back to an Applesoft BASIC program, to >be trapped by an ONERR GOTO routine: > >LDX #err >JMP $D412 > >will do the trick. It calls the routine Applesoft uses to generate its own >errors. Set the error code to whatever you want, and your ONERR GOTO >can check for it w/ PEEK (222). Also: > >JMP $DD76 generates a ?TYPE MISMATCH ERROR >JMP $DEC9 generates a ?SYNTAX ERROR > >all this may not be too clean, but under Applesoft it works like a charm. >If this isn't what you were asking, just ignore all the above. =) > >-- rubio Jumping to internal AppleSoft entry points is still not the world's best idea, no matter how unlikely they are to change. It's even a worse idea when dealing with ProDOS, because AppleSoft in ROM doesn't know how to handle MLI error codes. There are three routines you should consider. All are entered through BASIC.SYSTEM's global page at $BE00. BADCALL converts MLI error codes into BASIC.SYSTEM error codes (the ones ONERR GOTO routines expect). It takes the MLI error code in the A register and returns the BASIC.SYSTEM error code in A. Save other registers if you need them, just in case. The entry point, according to the P8 Technical Reference Manual (where all this is discussed) is $BE8B. ERROUT is vectored through $BE09. It takes an error code in the Accumulator, and sends it to an ONERR GOTO routine if one exists or otherwise prints the appropriate BASIC.SYSTEM error message (or AppleSoft message, I guess). PRINTERR is vectored through $BE0C. It takes an error code in the A register and prints the appropriate error message; it does not call ONERR GOTO routines if they exist. -- ============================================================================ Matt Deatherage, Apple Computer, Inc. | "The opinions represented here are Developer Technical Support, Apple II | not necessarily those of Apple Group. Personal mail only, please. | Computer, Inc. Remember that." ============================================================================