Converting SPL to HP C/XL [ SPL to HP C/XL Migration Guide ] MPE/iX 5.0 Documentation
SPL to HP C/XL Migration Guide
Converting SPL to HP C/XL
SPL is a procedure-oriented language. The basic structure of SPL and
most of the language constructs are machine-independent. However,
machine-dependent constructs are embedded within SPL to allow systems
programmers to optimize programs and access system-specific hardware
features.
The C language is a portable, machine-independent programming language.
Like SPL, C is a procedure-oriented language that uses many similar
constructs. This similarity, while making C a good candidate for
converting SPL programs, initially may cause some difficulties for
experienced SPL programmers. For example: C uses "=" as the assignment
operator; SPL uses ":="; C uses "==" as the equality operator; SPL uses
"=".
HP C/XL is the Hewlett-Packard implementation of C on MPE XL machines.
HP C/XL is a highly portable version of the C language.
SPL programs that rarely use machine-dependent constructs are easy to
translate to HP C/XL. Consequently, the first step in any SPL to HP C/XL
conversion is to isolate, and, if possible, eliminate the use of
machine-dependent SPL features. Machine-dependent SPL features include
direct reference to hardware registers, assembly instructions, and
explicit stack manipulation. Many of these operations are used to
optimize the MPE V environment and can be easily rewritten in higher
level SPL constructs that can be converted directly to HP C/XL.
Machine-dependent SPL features allow access to extra data segments to
overcome the limited address space on MPE V machines. This restriction
is not present in MPE XL, so these routines may be simplified or
eliminated. Such changes can be made (but not tested) in the MPE V
environment.
SPL programs sometimes rely upon the hardware stack environment of MPE V
machines. MPE XL machines do not have hardware stacks. Although you
could emulate a stack in software, using HP C/XL constructs and data
structures, usually the better choice is to redesign the algorithm and
rewrite the affected program.
Some high-level SPL constructs can be rewritten using alternative SPL
operations that are easier to translate into HP C/XL. For example, SPL
allows subroutines to be local to procedures. Although HP C/XL does
allow nested blocks (compound statements with local data), HP C/XL does
not allow any nesting of functions. Rewriting an SPL program to
eliminate subroutines, either by placing the code inline, or by
converting the SPL subroutine into an SPL procedure, will allow direct
translation of the program structure into HP C/XL.
MPE/iX 5.0 Documentation