Control Register type checking

The following examples use two instructions and are only concerned with the control register fields:
  • The Load Control (LCTL) instruction, in which the first and second operands are register fields requiring a resolved absolute value of 0 through to 15. This value specifies a Control Register (CR) which is treated as a 32-bit Control Register.
  • The Load Control (LCTLG) instruction, in which the first and second operands are register fields requiring a resolved absolute value of 0 through to 15. This value specifies a Control Register (CR) which is treated as a 64-bit Control Register.
Each unresolved control register field is an expression composed of one or more terms. The assembler checks only the first term:
  • If the term is not a symbol, no more checking is performed.
  • If the assembler type of the symbol is CR, no more checking is performed.
  • If the assembler type of the symbol is assigned but is not CR, the assembler issues a warning message (severity 4) about a type checking conflict.
  • If the assembler type of the symbol is not assigned, and if the flags show that at least one instance of an EQU with CR has been encountered, the assembler issues an informational message (severity 0) about a possible type checking conflict.
  • If the assembler type of the symbol is not assigned,and if the flags show that no instances of an EQU with CR have been encountered, no more checking is performed.
Figure 1 shows an example of Control Register checking, with a warning message about an incompatible symbol type, and an informational message about a symbol not assigned an assembler type due to the existence of an EQU statement with CR in the source code.
Figure 1. Control Register type checking with CR activated
00000000 B7EC A00C               0000000C     30          LCTL  14,12,12(10)
00000004 B7EC A00C               0000000C     31          LCTL  C14,C12,12(R10)
00000008 B72C A00C               0000000C     32          LCTL  A2,C12,12(R10)
** ASMA323W Symbol A2 has incompatible type with control register field
0000000C B7E1 A00C               0000000C     33          LCTL  C14,CON1,12(R10)
** ASMA324I Symbol CON1 may have incompatible type with control register field
00000010 EBEC A00C 002F          0000000C     34          LCTLG C14,C12,12(R10)
                                              35 *
                        0000000C              36 C12      EQU   12,,,,CR
                        0000000E              37 C14      EQU   14,,,,CR
                                              38 *
                        0000000A              39 R10      EQU   10,,,,GR
                        00000002              40 A2       EQU   2,,,,AR
                        00000001              41 CON1     EQU   1
Figure 2 shows an example of Control Register checking, with a warning message about an incompatible symbol type, and tolerance of symbols not assigned an assembler type due to the lack of an EQU statement with CR in the source code.
Figure 2. Control Register type checking with CR inactive
00000000 B7EC A00C               0000000C     30          LCTL  14,12,12(10)
00000004 B7EC A00C               0000000C     31          LCTL  C14,C12,12(R10)
00000008 B72C A00C               0000000C     32          LCTL  A2,C12,12(R10)
** ASMA323W Symbol A2 has incompatible type with control register field
0000000C B7E1 A00C               0000000C     33          LCTL  C14,CON1,12(R10)
00000010 EBEC A00C 002F          0000000C     34          LCTLG C14,C12,12(R10)
                                              35 *
                        0000000C              36 C12      EQU   12
                        0000000E              37 C14      EQU   14
                                              38 *
                        0000000A              39 R10      EQU   10,,,,GR
                        00000002              40 A2       EQU   2,,,,AR
                        00000001              41 CON1     EQU   1