LEDs status / Trap numbers

General discussions about using the Astrobe IDE to program the FPGA RISC5 cpu used in Project Oberon 2013
Post Reply
Helpdesk
Posts: 40
Joined: Sat Jan 01, 2011 5:43 am
Contact:

LEDs status / Trap numbers

Post by Helpdesk » Sun Dec 06, 2015 4:35 am

Do you know what the LEDs status 11000010 means?

cfbsoftware
Site Admin
Posts: 525
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: LEDs status / Trap numbers

Post by cfbsoftware » Sun Dec 06, 2015 4:49 am

The Oberon Trap error codes are:

1: Array bounds error
2: Type test error
3: Source array too long
4: Nil Pointer
5: Invalid procedure call
6: Divisor negative or zero
7: Assertion failure

The temporary trap handler Kernel.Trap adds 192 (i.e. 11000000b) before displaying the LEDs presumably to indicate that the trap has occurred during the startup sequence rather than in normal operation.

Hence 11000010 is Trap #2 occurring during the startup sequence.

When there is a trap, the module number (MT) is stored in bits 0..3 and the source line number (ORS.Pos) in bits 8..31 as well as the error code (num) in bits 4..7 as shown in the ORG.Trap code:

PROCEDURE Trap(cond, num: LONGINT);
BEGIN num := ORS.Pos()*100H + num*10H + MT; Put3(BLR, cond, num)
END Trap;

If you can somehow extract and display the module number and position as well you will be able to pinpoint where the error is occurring.

Post Reply