COBOL - Group home

AFP register control

  

With COBOL for z/OS, V5.1, you can use the AFP option to control the compiler usage of the Additional Floating Point (AFP) registers that are provided by z/Architecture processors.

The syntax is as follows:

The default is AFP(VOLATILE).

The Enterprise COBOL compiler generates code that uses the full complement of 16 floating point registers (FPR) provided by a z/Architecture processor. These FPRs are as follows:

  • Original FPRs, which are numbered 0, 2, 4, and 6
  • AFP registers, which are numbered 1, 3, 5, 7, and 8-15
Note: If your code runs on a version of CICS Transaction Server that is earlier than V4.1, you must specify AFP(VOLATILE).

 

If you specify AFP(VOLATILE), the AFP registers 8-15 are considered volatile, which means that they might be changed by a called subprogram. Therefore, the COBOL compiler generates extra code to protect the values in these registers.

If you specify AFP(NOVOLATILE), the AFP registers 8-15 are considered nonvolatile, which means that they are known to be unchanged or preserved by every called subprogram. Therefore, the compiler can generate more efficient code sequences for programs with floating point operations. It is the normal z/OS architecture convention.