Example of assembler main routine
Figure 1 shows a simple assembler main routine. In the example, the Language Environment environment is established, a message showing control is received in the routine, and the Language Environment environment terminates with a zero return code passed in R15 to the invoker.
If you write an assembler main routine, nominate the routine as a load module entry point using the END statement, as Figure 1 shows. Otherwise, you must explicitly declare the routine as the entry point at link-edit time.
Figure 1. Example
of a simple main assembler routine
*COMPILATION UNIT: LEASMMN
* ===================================================================
*
* A simple main assembler routine that brings up the
* LE/370 environment, prints a message in the main routine,
* and returns with a return code of 0, modifier of 0.
*
* ===================================================================
MAIN CEEENTRY PPA=MAINPPA
*
* Invoke CEEMOUT to issue a message for us
*
CALL CEEMOUT,(STRING,DEST,0),VL Omitted feedback code
*
* Terminate the LE/370 environment and return to the caller
*
CEETERM RC=0,MODIFIER=0
* ====================================================================
* CONSTANTS AND WORKAREAS
* ====================================================================
*
DEST DC F'2'
STRING DC Y(STRLEN)
STRBEGIN DC C'In the main routine'
STRLEN EQU *-STRBEGIN
MAINPPA CEEPPA , Constants describing the code block
CEEDSA , Mapping of the dynamic save area
CEECAA , Mapping of the common anchor area
END MAIN Nominate MAIN as the entry point