Vax performance V-008 SP User's Guide Page 76

  • Download
  • Add to my manuals
  • Print
  • Page
    / 176
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 75
Recommended and Required Source Changes
3.3 Flow Control Mechanisms
The following examples show two ways that the REI instruction is used in VAX
MACRO code for changing modes and one way to accomplish the same thing
using the EXE$REI_INIT_STACK routine for OpenVMS Alpha or OpenVMS
I64:
Before (1)
PUSHL new_PSL
PUSHL new_PC
REI
Before (2)
PUSHL new_PSL
JSB 10$
.
.
.
CONTINUE ;With new PSL
.
.
.
10$: REI
After
PUSHL Continuation_routine
PUSHL new_mode ;Not a PSL
CALLS #2, exe$rei_init_stack
.
.
.
Continuation routine: .JSB_ENTRY
When your program reaches the continuation routine, it will be executing in a
new mode at a new location and the old mode stack will be reinitialized. The
memory stack and (on OpenVMS I64) the register stack will be set to their bases
for the new mode.
Note that there is the issue of passing arguments to the outer mode routine. On
OpenVMS Alpha systems, most registers are preserved across REI. On OpenVMS
I64 systems, only R26, R27, and R10 (corresponding to Alpha registers R8, R9,
and R10) are preserved. If you need to pass more data, you cannot make a data
structure on the inner mode stack and pass the address to the outer mode routine
through a register, because the inner mode stack is reset to its base by EXE$REI_
INIT_STACK. You should instead allocate space on the outer mode stack (using
MFPR_xSP and MTPR_xSP) and place the data there.
3.3.8 Loop Nesting Limit
The compiler must identify loops in program code in order to generate code
correctly. A loop is a ‘‘nested’’ loop if it is inside another loop or if it partially
overlaps another loop. If loops are nested more than 32 levels deep, the
compiler will report a fatal error, and compilation will terminate. The VAX
MACRO assembler did not need to identify loops, and so did not enforce such a
restriction.
Recommended Change
If the compiler reports this error, restructure the code so that the program does
not exceed the limit.
3–14 Recommended and Required Source Changes
Page view 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 175 176

Comments to this Manuals

No comments