BEGIN: Begin assembler program

Code this general macro at the beginning of a z/TPF real-time program. It provides the necessary formatting for a program header in E-type assembler language programs. The information formatted by the macro is used by the loader and the application core load and restart information. The instructions needed to complete the linkage for the Enter-Back macros are also included in this macro.

The BEGIN macro also generates a TITLE card with an operand field consisting of the NAME parameter concatenated with the VERSION parameter. BEGIN must be the first statement of each assembler language ECB-controlled program to require the use of the program CSECT because it defines the CSECT and program header.

The BEGIN macro can also be coded in assembler code that is linked into C language object files.

Last updated

  • Start of changeChanged in 2024 (information only; no code change).End of change
  • Changed for PUT05.
  • Changed for PUT04.
  • Changed for PUT03.
  • Changed for PUT02.
  • Changed for PUT00.

Format

Read syntax diagramSkip visual syntax diagramlabelBEGIN NAME=XXXXNAME= ann..n,VERSION=99,VERSION= vv,IBM=NO,IBM=YESBASE=R8BASE=NONEreg,( reg),BASELESS=YES,TEST=NO,TEST=YES,TPFISOC=NO,TPFISOC=YES,DFERRTN=NO,DFERRTN=YES,TYPE=EXEC,TYPE=DATAKEYPOINT,DSECT= dsname,USEREG= usereg,TV= annn,AMODE=31,AMODE=64,EREGSAVE=NO,EREGSAVE=YES,EREGSAVE=ENABLETRNAME= annnTRNAME=NONE,SABR=NO,SABR=YES,ALIAS= annn
label
A symbolic name that can be assigned to the macro statement.
NAME=ann..n
The program name. The first character must be alphabetic; the remaining characters must be alphanumeric.
  • If TPFISOC=NO is specified (or defaults), the program name must be 4 characters.
  • If TPFISOC=YES is specified, the program name can be as many as 6 characters. The program will run in 64-bit addressing mode.

The program name will be set to XXXX if not coded or not valid.

VERSION=vv
A 2-character version number to be associated with this program. If not coded, a default version of 99 will be supplied.
IBM®
Specify one of the following:
NO
Signifies this is not IBM-released code.
YES
Signifies this is IBM-released code.
BASE
Specifies the base register to be used by this program, which can be one of the following:
NONE
Specifies no base registers.
reg
The valid base register (or registers) value (R1–R8). The default base register is R8.
BASELESS=YES
Generates baseless code; that is, relative instructions and other code that does not require a base register. See Programming considerations for more information about generating baseless code.
Note: If you specify the BASELESS parameter, additional code might be generated for every macro call.
TEST
Specifies one of the following:
NO
Indicates the TSTEQ equates will not be called.
YES
Indicates a request for the TSTEQ equates.

Do not code the TEST parameter when TPFISOC=YES is specified.

TPFISOC
Specifies whether or not the program is a C function that is written in assembler and uses the PRLGC and EPLGC macros, where:
NO
Indicates that the program is not a C function written in assembler using the PRLGC and EPLGC macros. If you specify this parameter, the program name must be 4 characters long.
YES
Indicates that the program is a C function written in assembler and uses the PRLGC and EPLGC macros. If you specify this parameter, the program name can be up to 6 characters long. The program will run in 64-bit addressing mode.
DFERRTN
Specifies whether z/TPFDF return-optional system errors will return control to the application, where:
NO
Indicates that the system error will exit and not return control to the application.
YES
Indicates that the system error will return control to the application.
TYPE
Specify one of the following:
EXEC
Specifies that this is executable code.
DATA
Specifies that this is a DATA segment that cannot be entered through standard program linkage.
KEYPOINT
Specifies that this is a DATA segment that contains keypoint data.
DSECT=dsname
Creates a user area on the application stack and assigns the specified name to it. If you specify this parameter, you must also code the APSTKC macro to define the end of the user area on the stack.
USEREG=usereg
Specifies the register (R1–R8 or R11–R13) that will be established as the base for the application stack user area.

Start of changeAfter the BEGIN macro is processed, this register points to the user area. You can code the USTKC macro to reestablish the base of the user area when you need it.End of change

TV=annn
Specifies a list of transfer vectors that are associated with the program. The transfer vectors must be defined in the same order as specified with this parameter.
AMODE
Specifies the addressing mode in which the program will run, where:
31
Indicates that the program will run in 31-bit addressing mode.
64
Indicates that the program will run in 64-bit addressing mode.

Do not code the AMODE parameter when TPFISOC=YES is specified.

EREGSAVE
Specifies whether the extended register save function will be used for this program, where:
NO
Indicates that the z/TPF system will not save R10–R13 across macro calls and that the DEFBC macro cannot be used in the program to control the extended register save function.
YES
Indicates that the z/TPF system will save R10–R13 across macro calls and that the DEFBC macro can be used in the program to control the extended register save function.
ENABLE
Indicates that the z/TPF system will not save R10–R13 across macro calls and that the DEFBC macro can be used in the program to control the extended register save function.
Note: Additional code will be generated for every macro call if you use the extended register save function.
TRNAME
Affects the name used for logging and tagging functions.
  • If this parameter is omitted the name supplied on the NAME parameter is used for logging and tagging.
  • annn may specify a different name to be used for logging and tagging.
  • If NONE is specified the logging and tagging name is not changed.
SABR
Specify one of the following:
NO
Indicates that the z/TPFDF global variable &ACPDBPL is not active.
YES
Indicates that the z/TPFDF global variable &ACPDBPL is active. The z/TPFDF global variable &ACPDBPL supports the Sabretalk environment.
Note: Do not code the SABR=YES when IBM=YES is specified.
ALIAS=annn
Specifies an alias name associated with the program. This is the transfer vector 0 name.

Entry requirements

Changing the variable that directs the code generation for EREGSAVE requires that either the EREGSAVE=YES or EREGSAVE=ENABLE be specified on the BEGIN macro.

Return conditions

None.

Programming considerations

  • For information about macro register conventions, see Register conventions.
  • A check is made by the macro for a valid NAME parameter. If the name is incorrect, the macro will insert the name XXXX. The program cannot be loaded with an XXXX name entry.
  • This macro calls the following macros:
    • TSTEQ, when TEST=YES
    • EB0EB, always
    • SYSEQ, always
    • SYSEQC, when IBM=NO
    • UXTEQ, when IBM=NO
    • XMSEQ, always.
  • When assembler language segments are linked into C language object files, the TPFISOC parameter must be coded as YES.
  • If you specify AMODE=31 and BASE=R8, the z/TPF system generates code that requires a base register. If you specify AMODE=64, BASELESS=YES, or a register other than R8 for the BASE parameter, the z/TPF system generates baseless code.

Examples

The following example defines a program with transfer vectors:
BEGIN NAME=CVIA,IBM=YES,VERSION=40,
      TV=(CVIB,CVIC,CVID,CVIE,CVIF,CVIG,CVIH,CVII,CVIJ,CVIK,
      CVIL,CVIM,CVIN)   
The following example defines a program that runs in 64-bit addressing mode:
BEGIN NAME=CVIA,IBM=YES,VERSION=40,AMODE=64
The following example defines a program with a user area allocated on the application stack:
         BEGIN NAME=CVZZ,IBM=YES,VERSION=40,
         DSECT=WORKAREA,USEREG=R4
SAVE_IT  DS    F
LAST_ADR DS    F
         APSTKC
The following example defines a program that uses multiple base registers:
 BEGIN NAME=CVZZ,IBM=YES,VERSION=40,
       BASE=(R6,R7,R8)
The following example defines a program that enables the use of the extended register save area function:
 BEGIN NAME=CVZZ,IBM=YES,VERSION=40,BASE=(R8),EREGSAVE=ENABLE