With the advent of 64-bit addressing, the definition of a save area within a called program is more complex than in earlier 24-bit and 31-bit addressing systems. On 64-bit systems, the General Purpose Registers are 64 bits in size, rather than 32, with bits 32-63 representing the relative contents of a traditional 32-bit register. hopefully the diagram below illustrates this effect and indicates how address consistency is maintained.

Non 64-bit GPR

 

Bits 0 - 31

64-bit GPR

Bits 0 - 31

Bits 32 - 63

Depending upon the AMODE and how the registers are to be used, their are three possible scenarios which will dictate the layout of the General Purpose Register save area, i.e.

Programs which do not amend bits 0 - 31 of a 64-bit register

For this type of program, which may be a program migrated from OS/390 or earlier systems, a traditional 18-word save area can be defined, and registers saved with either a STM instruction, or the SAVE macro. The 18-word save area format is illustrated below.

Used by language products.

Address of previous save area (Stored by Calling Program)

Address of next save area (Stored by Target Program)

Contents of GPR 14

Contents of GPR 15

Contents of GPR 0

Contents of GPR 1

Contents of GPR 2

Contents of GPR 3

Contents of GPR 4

Contents of GPR 5

Contents of GPR 6

Contents of GPR 7

Contents of GPR 8

Contents of GPR 9

Contents of GPR 10

Contents of GPR 11

Contents of GPR 12

The illustration above assumes that the convention of issuing STM 14,12,12(13) has been followed.

AMODE 64 programs, i.e. those which start in this mode

This may well be a new program designed specifically to run in and exploit AMODE 64. In this instance the General Purpose Register save area will be a 36-word table as illustrated below. ( Registers can be saved with either a STMG instruction, or the SAVE macro.)

Used by language products.

F4SA

Contents of GPR 14

Contents of GPR 15

Contents of GPR 0

Contents of GPR 1

Contents of GPR 2

Contents of GPR 3

Contents of GPR 4

Contents of GPR 5

Contents of GPR 6

Contents of GPR 7

Contents of GPR 8

Contents of GPR 9

Contents of GPR 10

Contents of GPR 11

Contents of GPR 12

Address of previous save area (Stored by Calling Program)

Address of next save area (Stored by Target Program)

The illustration above assumes that the convention of issuing STMG 14,12,8(13) has been followed.

Non-AMODE 64 programs which change bits 0 - 31 of a 64-bit register

If a 36-word (144-byte) save area has been provided, then the layout and processing for saving and restoring regsiters is as describe above for AMODE 64.

If an 18-word (72-byte) save area has been provided, then the target program must save the low value portion of the registers in the save area provided, and then create its own save area to hold the high value portion of the registers. This second save area will be 216-bytes in size in the following format.

Used by language products.

F5SA

Contents of GPR 14

Contents of GPR 15

Contents of GPR 0

Contents of GPR 1

Contents of GPR 2

Contents of GPR 3

Contents of GPR 4

Contents of GPR 5

Contents of GPR 6

Contents of GPR 7

Contents of GPR 8

Contents of GPR 9

Contents of GPR 10

Contents of GPR 11

Contents of GPR 12

Address of previous save area (Stored by Calling Program)

Address of next save area (Stored by Target Program)

High values of GPR 0

High values of GPR 1

High values of GPR 2

High values of GPR 3

High values of GPR 4

High values of GPR 5

High values of GPR 6

High values of GPR 7

High values of GPR 8

High values of GPR 9

High values of GPR 10

High values of GPR 11

High values of GPR 12

High values of GPR 13

High values of GPR 14

High values of GPR 15

F5SA

Length of Area

This type of save area may well be useful for 31-bit programs receiving control from a 64-bit routine.

End of topic

Copyright © KMS-IT Limited 2002