SWI error blocks are the key mechanism by which errors are returned from SWIs. Whenever a SWI call exits with the V flag set, R0 will contain a pointer to an error block, with the following structure:
Offset | Contents |
---|---|
+0 | Error number |
+4 | Error String (zero terminated) |
The error number is broken down as follows:
Bits | Meaning when set |
---|---|
0-7 | Basic error number |
8-23 | Error owner or Error Generator |
24-29 | Reserved. Must be 0 |
30 | Defined to be 0 |
31 | Error is serious (hardware). Owner is then; |
0 Machine failure | |
1 Co-Processor failure | |
2 Floating Point | |
3 Econet |
X SWI’s are allowed to generate (rather than return) serious errors.