COBOL - Group home

How to determine location of COBOL special register variables

  

With Enterprise COBOL for z/OS V5.1.1, the LIST option output in the compiler listing is enhanced to include a new special register table. There you can find the location information for all the COBOL special register variables.

The offset to the table can be found in the second entry of the PPA3, and the offset is relative to the starting address of the PPA3. The special register table format is similar with that of the base locator table.

The following example further explains the special register table:

image

Each entry in the special register table consists of the following items:

  • A byte which represents the following information:
    • Special register ID number (bits 0 - 4). ID = 1 represents the RETURN-CODE register
    • Access mode (bits 5 - 8):
      • MODE = 0; Base Address = Top of Stack
      • MODE = 1; Base Addr = NORENT Static
      • MODE = 2; Base Addr = 32-bit RENT static
      • MODE = 3; 24-bit NORENT static
  • An offset to the special register

At the end of the special register table, there's a null byte indicating that you have reached the end of the table.