HP Pascal/iX Programmer's Guide (31502-90023)

11- 18
keyboard, control transfers to the procedure control_y_handler, which
writes the current loop counter value, then re-enables the subsystem
break, and returns to the point in the loop where the interrupt occurred.
PROGRAM control_y_test (output);
VAR
count : integer;
i : integer;
oldplabel : integer;
{Intrinsic Declarations}
PROCEDURE XCONTRAP; INTRINSIC;
PROCEDURE RESETCONTROL; INTRINSIC;
{User-defined Subsystem Break Handler}
PROCEDURE control_y_handler;
BEGIN
writeln('<Control-Y>: Count = ', count:1); {write counter value}
RESETCONTROL; {re-enable subsystem break}
END;
BEGIN
{Arm the Subsystem Break Handler,
specifying control_y_handler as the user-defined routine}
XCONTRAP (BAddress (control_y_handler), oldplabel);
{Loop}
FOR i := 1 TO 30000000 DO
count := i;
END.
If you compile, link, and run the preceding program on an MPE/iX system
and press CONTROL Y several times while it is running, the program prints
the value of count each time you press CONTROL Y. For example:
CONTROL Y: Count = 121765
CONTROL Y: Count = 2731435
CONTROL Y: Count = 5789345
CONTROL Y: Count = 10135467
CONTROL Y: Count = 23618560
HP TOOLSET/XL and HP Symbolic Debuggers
The HP TOOLSET/XL debugger is available on the MPE/iX operating system.
The HP Symbolic Debugger is available on both the HP-UX and MPE/iX
operating systems. The HP TOOLSET/XL debugger supports a subset of HP
Pascal features. The HP Symbolic Debugger supports the HP Pascal
language.
To debug your program with HP TOOLSET/XL or HP Symbolic Debugger, you
must compile it with the compiler option SYMDEBUG. SYMDEBUG causes the
compiler to generate the symbolic debug information that either debugger
needs.
HP TOOLSET/XL and HP Symbolic Debugger need different information; if you
compile part of your program for HP TOOLSET/XL and part of it for HP
Symbolic Debugger, neither HP TOOLSET/XL nor HP Symbolic Debugger will
work with it.
For more information on the SYMDEBUG compiler option, refer to the
HP