4. ZCON DC Z(0,VAR,0).
6.2 Basics and Conventions 1 Origin and Format
The HAL/S-FC compilers are supplied with runtime libraries. The library for PASS is a partitioned dataset (PDS) containing members in AP-101 load module format. The library for BFS is a PDS that contains object modules in the Eclipse format.
The runtime library objects are built by assembling the identically named members of a source library that consists of statements written in AP-101 Basic Assembly Language (BAL). Each source library member is assembled with the value of the &SYSPARM system variable set to 'PASS' and 'BFS' respectively. The &SYSPARM variable is used in the macro library routines to isolate code sequences that are unique to either PASS or BFS. A macro library is used to standardize frequently used sequences of source code.
The runtime libraries are built from these runtime library objects using methods that differ substantially between PASS and BFS. For PASS, some source library members have more than one entry point, in which case library ALIAS names are generated for each entry using the FIXOBJ tool. The AP-101 link editor is then invoked to generate the library in load module format. For BFS, the object modules are converted from AP- 101 to Eclipse format using the SATSOBJ tool. The input commands to SATSOBJ specify that members beginning with '#L' are to be tagged as DATA type and all other library members as CODE type. The type assigned to a library member is used by the PILOT (Program Integration and Loading Tool) program to determine where the member should be placed in memory. The BFS runtime library is also marked with Version 0 to ensure compatibility with other objects generated by flight software.
Also included with the HAL/S-FC compilers are the ZCON libraries associated with PASS and BFS. The PASS ZCON library is created by assembling its associated source code using the same procedures that are used for the PASS runtime library. The BFS ZCON library is created using a special tool, BLDQCON, that simply requires a member list from the runtime library PDS as its input. The BFS ZCON library is also marked with Version 0 to ensure compatibility with other objects generated.
6.2.2 Purpose
The runtime library is used to supply routines, data and interfaces which are needed to execute a HAL/S program or group of programs which are not produced by the compiler's code generator. Most of the library consists of subroutines which are called from compiler generated code in a HAL/S statement.
6.2.3 Intrinsics and Procedure Routines
The library routines are divided into two groups: intrinsics and procedures. The main distinction is that procedure routines save the passed contents of all fixed point registers, while intrinsics do not. For this reason, a procedure can call another routine (e.g., vector (VV10S3) magnitude calls SQRT), but an intrinsic cannot. Intrinsics do not have a new stack level and therefore do not have any stack work areas. Because intrinsics do not save all passed contents of fixed point registers, they cannot restore them and must not destroy any register contents that must be returned to the calling program. Expansions of the macros within intrinsic routines are different from the expansions within procedure routines.
6.2.4 Register Conventions in Runtime Library Routines 6.2.4.1 General Purpose Registers R0-R7.
6.2.4.2 Floating Point Registers F0-F7.
Internal compiler tables indicate which floating point registers are used by each RTL routine. Any register which is used in an RTL routine will be reloaded after returning from that routine before further use. The only exception to this rule is registers which are not flagged in the compiler's internal tables, but are instead saved and restored by the RTL routine upon entry and exit from the routine.
6.2.4.3 Interface Conventions.
In addition to the parameter passing conventions summarized in general form in the previous two sections and given in detail in the individual library routine descriptions, the compiler has information defining the linkage conventions and register usage for each routine.
R1-R3, R5-R7 : free use;
R4 : return address during calling and exiting intrinsics, otherwise free use;
R0 : stack base;
Parameters : Intrinsics: any or all of R1, R2, R3, R5, R6, R7 can be used for parameter passing.
Procedures: any or all of R2, R4, R5, R6, R7 can be used for parameter passing.
This section contains that information in a list formatted in four columns as follows:
Any modifications to compiler or library should be made carefully so as to maintain this interface properly.
NAME The primary or secondary entry point name.
CALL TYPE Either PROCEDURE or INTRINSIC to distinguish between routines which must be called via the SCAL instruction and those that must be called using BAL.
BANK0 YES indicates that the routine will always reside in Sector 0 of the GPC and may therefore always be called directly (no ZCON needed). NO indicates that the routine may reside in a sector other than 0 and must therefore be called via a long indirect address constant (ZCON).
Registers assumed to be modified
A list of registers which the compiler assumes to be modified across a call to the routine. Any registers not listed may be assumed to remain unmodified and therefore to maintain their previous contents. Underlined registers are not actually modified by the RTL routine, but the compiler still assumes that they are.