SPL to HP C/XL Migration Guide (30231-90001)
2- 3
| <<
comment-text
>> | Similar to SPL's <<
comment-text
>>. |
| | |
| !
comment-text to end of record
| |
| | |
---------------------------------------------------------------------------------------------
Program and Subprogram Structure
Table 2-5. Program and Subprogram Structure
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| An SPL program consists of a single | An HP C/XL program consists of declarations |
| BEGIN-END block that contains global | and function definitions. The "main body" |
| declarations, procedures (which may include | of a program is a function named main. |
| subroutines), and a main body of | Functions may have local data declarations. |
| statements. Procedures may have local data | Functions cannot contain subroutines. |
| declarations; subroutines cannot. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| A subprogram has the same structure as a | A "subprogram" compilation unit has the |
| main program, except that the block is | same structure as a main program, except |
| preceded by the compiler command $CONTROL | that it has no main function. |
| SUBPROGRAM and it has no main body. Outer | |
| blocks of subprograms are not compiled. | |
| | |
---------------------------------------------------------------------------------------------
In general, SPL procedures convert directly to HP C/XL functions.
Hardware Concepts
With the exception of the hardware stack structure, which does not exist
in MPE XL, the concepts of processes and code/data separation are
essentially the same on both MPE V and MPE XL.
Code and Data Segments
Table 2-6. Code and Data Segments
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| SPL provides code segmentation and access | HP C/XL provides neither segmentation nor |
| to the registers and counters (PB, P, and | register access. $CONTROL SEGMENT compiler |
| PL) that manage program code. | commands must be removed. Register |
| | references must be recoded. |
| | |
---------------------------------------------------------------------------------------------
| | |
| SPL provides data segmentation and access | HP C/XL provides neither segmentation nor |
| to the registers (DB, DL, Q, S, and Z) that | register access. Register references must |
| manage program data. | be recoded. |
| | |
---------------------------------------------------------------------------------------------