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

9- 17
BEGIN
PROCEDURE splprv(cstr,int1,int2,sum); OPTION VARIABLE;
VALUE int1,int2;
INTEGER int1,int2,sum;
BYTE ARRAY cstr;
BEGIN
sum := int1 + int2;
MOVE cstr := "Sum of two numbers: ";
END;
END.
Switch Stubs
A switch stub is a program that allows your HP Pascal program, which is
compiled in Native Mode (the default on PA-RISC machines) to call a
routine compiled in Compatibility Mode (the default on earlier HP 3000
machines). The routine must reside in a Compatibility Mode SL.
Figure 9-1 shows how a switch stub works. When the program calls the
routine, what actually happens is that the program calls the switch stub
(in Pascal) and the switch stub calls the routine in the Compatibility
Mode SL. This is transparent to the program and routine (except for
performance, which is slower). It is the responsibility of the switch
stub to make whatever transformations are necessary to call the
Compatibility Mode routine.
Figure 9-1. How a Switch Stub Works