Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An error handling routine may be set up by using the system OS_Erh whose specification is:

 

...

Code Block
languagenone
titleRST 20H,

...

DEFW $75

In:

...

IN:
     A = 0, other values reserved for system use

...


     B = 0

...


     HL = address of new error handler

...


     HL = 0, use default system error handler (in lower 8K of segment 0)

...



OUT:

...


     Fc = 0

...


     A = old call level

...


     HL = address of old error handler

...



Registers changed after return:

...


     ...CDE../IXIY same

...


     AFB...HL/.... different


 

We can now consider the code the error handler should include. Fatal errors may be ignored (include a RET Z at the start), because there is no reasonable action to take anyway except termination of this instantiation of the application. An RC_SUSP error code will generally be completely ignored by the error handler whereas RC_ESC may want to be acknowledged using OS_Esc, or left pending for the main part of the application to acknowledge. RC_DRAW could be responded to by calling a routine to regenerate the screen and then quitting the error handler with A = RC_SUSP and Fc = 0 as though nothing had ever happended. Other errors may want to be reported, by outputting an error message.

...