|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Functions | |
| void | doreadern (void) |
| void | dosettrap (void) |
| SetErr ($D201 seterr): install an error handler. | |
| void | doclrerr (void) |
| void | dogetsp (void) |
| $D203 (getsp, commented out in blitz2.s): the caller's stack pointer. | |
| void | doputsp (void) |
| $D204 (putsp, commented out in blitz2.s): set the stack pointer. | |
| void | dofail (void) |
| static void | codeinit (void) |
| void | errtraplib_codefinit (void) |
| void | newtrap (void) |
| void | data (void) |
| static ULONG | dofail_c (ULONG num) |
| ErrFail ($D205 errfail): report the trapped error after all. | |
| static void | codefinit_c (void) |
| static ULONG | doreadern_c (void) |
| Ern ($D200 ern): the number of the last trapped error. | |
| static void | doclrerr_c (void) |
| ClrErr ($D202 clrerr): remove the SetErr handler. | |
Variables | |
| APTR | oldtrap |
| ULONG | ertext |
| ULONG | ercode |
| ULONG | erstack |
| UWORD | ernum |
|
static |
|
static |
| void data | ( | void | ) |
| void doclrerr | ( | void | ) |
|
static |
ClrErr ($D202 clrerr): remove the SetErr handler.
Runtime errors go to the old TRAP #0 vector again. Keeps all registers.
| void dofail | ( | void | ) |
|
static |
ErrFail ($D205 errfail): report the trapped error after all.
If an error happened (a message was stored by newtrap), the old trap handler is put back (fixed (#1069): the task's, the original put back the CPU's TRAP #0 vector) and the error is given to it with TRAP #0 (the debugger / runtime error handler), which normally ends the program. Keeps d1/a0-a1 (a0 only if there was no error).
| num | d1: passed on in d1 to the trap |
| void dogetsp | ( | void | ) |
$D203 (getsp, commented out in blitz2.s): the caller's stack pointer.
Assembler (it reads sp): the stack pointer after the return.
| void doputsp | ( | void | ) |
$D204 (putsp, commented out in blitz2.s): set the stack pointer.
Assembler: sets sp to d0 and returns through the return address taken from the old stack.
| void doreadern | ( | void | ) |
|
static |
Ern ($D200 ern): the number of the last trapped error.
BUG(orig) (#133): newtrap stores d1 of the trap, but no runtime error sets d1, so the value is random.
| void dosettrap | ( | void | ) |
SetErr ($D201 seterr): install an error handler.
Assembler (it reads sp): remembers the handler code and the stack pointer of the caller (after the return). A later runtime error (TRAP #0 in user mode) continues at the handler with that stack.
| void errtraplib_codefinit | ( | void | ) |
| void newtrap | ( | void | ) |
| ULONG ercode |
|
extern |
| ULONG erstack |
|
extern |
|
extern |