| CSCI 567, Fall 2006 | Assignment 1 |
This first assignment (the only programming assignment this semester) will acquaint you with the differences between the 24-bit and 31-bit addressing modes. It isn't particularly difficult, but it will require you to read IBM documentation for the LOAD macro, and for the STORAGE macro (which replaces GETMAIN and FREEMAIN).
You are to design, code, and execute two programs, ABOVE and BELOW, satisfying the following requirements:
Program ABOVE is to reside above the 16M line and is to run in 31-bit addressing mode (but that fact is NOT known in advance to BELOW); ABOVE is to be invoked by JCL (EXEC PGM=ABOVE)
Program ABOVE will normally reside above the line, unless an error is made in the way it is written. You can check whether ABOVE is running above the line by first placing the TEST16M macro instruction in your ABOVE program, then invoking it just after your entry linkage by specifying
TEST16M ABOVE
The instructions generated by the TEST16M macro will cause an S0C3 abend if ABOVE is not running above the line. TEST16M should be included in your graderun.
Program BELOW is to reside below the 16M line and is to run in 24-bit addressing mode (but that fact is not known in advance to ABOVE); BELOW is to be CALLed by ABOVE after ABOVE uses the LOAD macro to bring BELOW into memory. You can check whether BELOW is running below the line by first placing the TEST16M macro instruction in your BELOW program, then invoking it just after your entry linkage by specifying
TEST16M BELOW
The instructions generated by the TEST16M macro will cause an S0C3 abend if BELOW is not running below the line. TEST16M should be included in your graderun.
Program BELOW is to issue the message 'BELOW ENTERED' using XPRNT
Program BELOW should then return control to ABOVE (in ABOVE's AMODE)
Addressing and residency mode for ABOVE and BELOW are to be set by the assembler instructions AMODE and RMODE.
You may not use the XSAVE and XRETURN macros for either program. You may use the OS SAVE and RETURN macros if you wish, but in any case you must establish base registers, save areas and linkage yourself.
See the documentation for the LOAD macro for information on how ABOVE is to determine the AMODE of BELOW.
Program BELOW should NOT be reentrant.
Your JCL should invoke procedure HLASMCE twice (once for each program), then a step to invoke ABOVE. ABOVE should set a return code of zero. All JCL should be printed (use the default MSGCLASS) and all linkage editor output should be seen (use EPARM='LIST,XREF'). You will need to provide a //LKED.SYSLMOD DD card for both invocations of the linkage editor, and this temporary load library will be used as a //STEPLIB DD by the last step.
See the OS/390 Assembler Services Guide, Ch 5 for information about 31-bit addressing. See the assembler coding guidelines for additional information.
Turn in the resulting job listing with complete documentation throughout. It will be especially important for you to explain your use of the subroutine linkage instructions.