SVC 4, GETMAIN (all E and L options, VU and VC)

Restriction: This topic applies to Windows environments only.
INPUT
  • Register 1

    Address of parameter list.

OUTPUT
  • Register 0

    Amount of memory obtained

  • Register 1

    Address of allocated memory.

  • Register 15
    Return code:
    • 0=Successful
    • 4=Insufficient memory available

Parameter list, 10 bytes in length.

Bytes Description
0-3 Element request: length requested

Variable request: address of a double-word containing the minimum and maximum lengths requested. Format is:

0 Zero

1-3 Minimum length

4 Zero

5-7 Maximum length

List request: address of a list of lengths requested (one word per request, the last word contains X'80' in byte 0.)

4 Zero
5-7 Element request: address of a word GETMAIN initialized with the address of the area acquired

Variable request: address of a double-word GETMAIN initialized with the address of the area acquired and the actual length allocated.

List request: address of a list area GETMAIN initialized with the addresses of the areas allocated for each requested length in the list.

8 8 Flag byte:

10 Request is for storage aligned on a page boundary.

00 Unconditional element request.

20 Conditional element request.

80 Unconditional list request.

A0 Conditional list request.

C0 Unconditional variable request.

E0 Conditional variable request.

9 Subpool to which memory should be allocated.