%on %event <eventno>, <eventno>, ..... %start
...
finish
"%event" is optional in the statement above.
Once the event has been trapped, further information may be obtained by interrogating the built-in record EVENT..
%recordformat eventfm(%byte event,sub,%short line,%integer extra,
%string(255)message,%integerarray r(0:15))
where sub and extra have the meanings defined in a later section.
The differences between the new scheme and the old one are..
There are some changes in the detailed meaning of some sub-events. Event 9 is now reserved strictly for End-of-Input. Filestore failures are handled by Event 3. Events 3 and 4 switch meanings.
The reversal of the significance of events 3 and 4 compared with EMAS IMP was unintended in IMP - 77. The re-reversal shown above corrects this in the interests of goodwill.
0 - normal termination (%stop)
1 - forced termination (^Y)
2 a Bus Error:
Attempt to access an operand at non-existant location a.
3 a Address Error:
Attempt to access a non-byte operand at odd address a.
4 - Illegal Instruction / Usually a result of the
5 - Reserved Exception or Trap / program being corrupted
8 - Using a privileged instruction while in user mode.
1 - integer overflow 2 - real overflow 3 - string overflow (more than 255 characters) 4 - division by zero
1 - store space exhausted 2 - output limit exceeded 3 - time limit exceeded
1 - data transmission error 2 - timeout 3 code failure to open file 4 code failure on other file system operation
1 char non - numeric char for numeric input
1 - invalid values for %for loop 2 culprit illegal exponent for exponentiation 3 - upper bound less than lower in array declaration
1 value value outside range of destination/result 2 index array index out of bounds 3 index switch index out of bounds (if distinguished from 2)
1 - unassigned variable (value or pointer) 2 index switch to undefined label 3 - %for loop variable corrupt
view:events printed on 16/02/89 at 16.49