Dual Programming Modes (new) [ Introduction to MPE XL for MPE V Programmers Migration Guide ] MPE/iX 5.0 Documentation
Introduction to MPE XL for MPE V Programmers Migration Guide
Dual Programming Modes
(new)
For the programmer, the MPE XL seems to have two different operating
systems: Compatibility Mode (CM) and Native Mode (NM). CM is designed to
look familiar to MPE V/E programmers. NM is designed to take full
advantage of the HP-PA architecture. The two can communicate.
You can develop new programs on CM or on NM. If you are familiar with
programming in MPE V/E, you may find it easier, especially at first, to
program in CM. Programmers who try NM, however, find that, in many cases,
it takes less programming effort to accomplish the same task.
In CM, the program development cycle appears to be like that of MPE V/E.
The process is different in MPE XL NM. The largest impact is virtual
memory, which eliminates the need for segmentation. The following table
shows a comparison.
Table 1-1. MPE XL and MPE V/E Program Development
-------------------------------------------------------------------------------------------------
| | | | |
| Development | MPE V/E | MPE XL CM | MPE XL |
| Step | Tool | Tool | Tool |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| Edit Source Code | Edit/3000, TDP/3000, | Editor, TDP | Editor, TDP, |
| | Toolset | | Toolset/XL |
| | | | |
| Compile | MPE V/E Compiler | MPE V/E Compiler | MPE XL NM Compiler |
| | Commands | Commands (plus Object | Commands (includes |
| | | Code Translator) | Optimizer) |
| | | | |
| Linking | Segmenter | Segmenter | HP Link Editor/XL |
| | | | |
| Link Edit a Program | PREP | PREP | LINK |
| | | | |
| Create a Relocatable | SEGMENTER | SEGMENTER | LINKEDIT |
| Library | | | |
| | | | |
| Create a Segmented | SEGMENTER (SL) | SEGMENTER (SL) | LINKEDIT (XL) |
| Library or Executable | | | |
| Library | | | |
| | | | |
-------------------------------------------------------------------------------------------------
CM and NM Compilers
Separate high-level language compilers are provided for CM and NM. You
can usually change between modes simply by recompiling. You may
experience some difficulty between modes with data alignment, especially
floating-point numbers. Also, some intrinsics are different.
The following table shows which language compilers are available.
Table 1-2. MPE Programming Languages
----------------------------------------------------------------------------------------------
| | | |
| MPE V/E | MPE XL CM | MPE XL NM |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| N/A | N/A | HP C/XL |
| | | |
| COBOL II/V | COBOL II/V | COBOL II/XL |
| | | |
| HP FORTRAN 77/V | HP FORTRAN 77/V | HP FORTRAN 77/XL |
| | | |
| FORTRAN 66/V | FORTRAN 66/V | N/A |
| | | |
| Pascal/V | Pascal/V | HP Pascal/XL |
| | | |
| RPG/V | RPG/V | RPG/XL |
| | | |
| HP Business | HP Business | HP Business |
| BASIC/V | BASIC/V | BASIC/XL |
| | | |
| SPL/V | SPL/V | N/A |
| | | |
----------------------------------------------------------------------------------------------
NOTE Although a limited number of compilers are available in
Compatibility Mode (CM), MPE XL provides run-time support, via CM
libraries, for all HP-supported MPE V/E-based languages. Thus, any
program that was compiled on an MPE V/E-based system using an HP
supported compiler, can be executed in CM on an MPE XL-based
system.
Switching between CM and NM
The Switch subsystem helps you create a program that alternates operation
between CM and NM. You can make calls from one mode to a routine in the
other mode. This way, your NM program can call a CM procedure, or vice
versa.
A switch stub is a routine that acts as an intermediate step between a
calling procedure in one operating mode and a called procedure in
another. A call to a switch stub looks exactly like a call to the actual
procedure. Thus, making cross-mode procedure calls is transparent to the
calling application and its users.
The Switch Assist Tool (SWAT) helps you create switch stubs from NM to
CM. For more information on creating switch stubs and SWAT, refer to
Switch Programming Guide (32650-90014).
Emulating or Translating Migrated MPE V Code
Programs originally written on an MPE V/E system can be migrated to MPE
XL CM. You decide whether to emulate or translate MPE V/E compiled source
code in order to use it on MPE XL.
Emulating is done by the emulator. It uses a branch table to execute
HP-PA instructions that are equivalent to the MPE V/E code. MPE V/E
files migrated to MPE XL will be emulated each time they are run, unless
you translate them.
Translating is done by the Object Code Translator (OCT). It translates
the code and appends the translation onto a copy of the original file.
Translated code usually runs faster than emulated code. Because both the
MPE V/E version and the MPE XL version is included, it is flexible.
However, the appended file is larger, and usually requires more than
twice as much storage space as the original.
MPE/iX 5.0 Documentation