Code: Select all
PROCEDURE Sqrt*(x: REAL): REAL;
(* ... *)
BEGIN
ASSERT(x >= 0.0, Error.input);
(* ... *)
END Sqrt;
However, I don't understand how that error code can be used at run-time. The code generated with or without the error code is the same (apart from different positions in the trap instruction):
Code: Select all
PROCEDURE Sqrt*(x: REAL): REAL;
(* ... *)
ASSERT(x >= 0.0, Error.input);
. 3 80E00004H LDW r0, sp, 4
. 4 D507EF7CH BL,LT r12 trap #7, pos: 2031
(* ... *)
Code: Select all
PROCEDURE Sqrt*(x: REAL): REAL;
(* ... *)
ASSERT(x >= 0.0);
. 3 80E00004H LDW r0, sp, 4
. 4 D507E27CH BL,LT r12 trap #7, pos: 2018
(* ... *)
What do I miss here? How can I use the error code given in the ASSERT statement?