The GETMAIN (and FREEMAIN) macros have one positional parameter: GETMAIN R,keyword parameters. This positional parameter is called - don't ask why, 'cause I don't know - the "form" of the GETMAIN or FREEMAIN macro. The R form goes back to OS/360, and may imply "register" since only registers convey the parameters to the SVC service that performs the request. Other OS/360 variants of the macro pass parameter data through a parameter list and use a different SVC.bobguo wrote:... i don't know the meaning of 'R'(within your sentence 'In the R form GETMAIN macro')
In any event, the question was, why is BAL 1,*+4 used? Actually, I cheated a little bit; I didn't tell you the R form of the FREEMAIN macro which uses the same SVC as the R form of the GETMAIN macro, sets the high order 8 bits of register 1 to 0. A little more background: in OS/360 three different SVCs are used for storage management. SVC 4 is GETMAIN with some sort of parameter list, SVC 5 is FREEMAIN with some sort of parameter list, and SVC 10 is GETMAIN and FREEMAIN with parameters passed to it in registers 0 and 1. MVS added a fourth SVC for GETMAIN and FREEMAIN. At some point the STORAGE macro was added, which uses the PC instruction rather than the SVC instruction.
Another useful tool is MVS Diagnosis: Reference for your z/OS release. It has chapters like "SVCs and associated macros" and "SVC descriptions," with a sub chapter for each SVC. If you check SVC 10 you can find out what is in register 1. Once you know what it expects in register 1 you then have to figure out how the BAL sets register 1, which I have sort of laid out for you already in this topic. A little quality time spent with Principles of Operation and MVS Diagnosis: Reference should enable you to answer the question.
I have known the answer for many years, in part because a friend of mine working on another program got into trouble because he didn't really know the answer to this very question and I had to dig up the answer.