Tools And Utilities Layer; Error Handlers - Texas Instruments TI-83 Plus Manual

Third release
Hide thumbs Also See for TI-83 Plus:
Table of Contents

Advertisement

Chapter 2: TI-83 Plus Specific Information
T
U
OOLS AND

Error Handlers

Error exception handlers can be set up to capture any system error that occurs while
executing a block of code that an error handler is placed around.
A macro is used to install the error handler:
AppOnErr
If your assembler does not support macros, use the following code:
Label = Location that the Program Counter (PC) is set to if a system error
occurs.
All registers are destroyed, except the Accumulator.
Six pushes are made onto the stack. Make sure all the information that is
needed from the stack is removed before installing the error handler.
A macro is also used to remove the error handler:
AppOffErr
If your assembler does not support macros, use the following code:
The above is used when the error handler is no longer needed and no system error
has occurred.
The Stack Pointer (SP) must be at the level it was at immediately following the
AppOnErr. Do not call a routine to set the error handler and then remove it outside of
that routine.
If an error occurs while the handler is place:
The system restores the SP, the Floating Point Stack, and the Operator Stack
back to their levels when the handler was initiated.
The error handler is removed from the stack.
The PC is set to the Label specified when the handler was initiated and
execution begins there. The Accumulator contains the error code for the error
that tripped the handler.
At this point, the Application can:
Ignore the error.
Display its own error message.
TI-83 Plus Developer Guide
L
TILITIES
AYER
Label
LD
HL,Label
CALL
APP_PUSH_ERRORH
CALL
APP_POP_ERRORH
99
Third Release May 28, 2002

Advertisement

Table of Contents
loading

Table of Contents