Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
Chapter 5 117
Using Subsystem Break
Subsystem Break Processing
Subsystem Break Processing
A final consideration when building subsystem break processing
capabilities into your program has to do with whether your program
will run in Native Mode, Compatibility Mode, or both.
Native Mode vs. Compatibility Mode
So far, the discussion in this chapter has assumed that all processing is
to take place in Native Mode (NM). There are times, however, when you
will want to allow subsystem break processing to take place in
programs that will run in Compatibility Mode (CM), or in both CM and
NM. It is possible to do so by following some common sense rules when
arming the
[CTRL]Y trap.
If your program is to run in Native Mode only, you should use a Native
Mode subsystem break procedure as well. XCONTRAP will execute in
Native Mode and pass a 32-bit value as the external address of the
subsystem break handler. This situation presents the most straight
forward case for subsystem break processing. If the subsystem break
character is received during execution of the program, control will
simply be passed from the main application, which is running in Native
Mode, to the break handler, which will also run in Native Mode. If your
program is a Compatibility Mode application, the situation is
considerably different. In this case, since XCONTRAP will execute in
Compatibility Mode, it is only possible to pass a 16-bit external address
in the call. This means that your trap handling routine must be a CM
procedure as well.
If your program executes in both NM and CM the situation becomes
somewhat more complex. HP recommends that you use a Native Mode
trap handler in this case, which would mean that you would have to call
XCONTRAP in Native Mode to pass a 32-bit address for the trap
procedure. It is possible, however, to use a Compatibility Mode trap
handler. (The discussion of the XCONTRAP intrinsic in Chapter 8,
“Intrinsics Reference,” includes instructions for specifying a 16-bit
address in the 32-bit plabel field.)
If you have supplied a Native Mode trap procedure, and the program is
running in CM when a subsystem break signal is received, MPE/iX will
switch to NM to allow the trap procedure to run. The reverse is also
true; that is, a program running in NM with a CM trap handler will
switch to CM if a subsystem break occurs.
For more information on handling
[CTRL]Y traps, see the Trap
Handling manual.