Special Cases

This topic lists the following special cases for enforce operators:

  1. Constants which do not fit. Constants which do not fit can be split in 2 case:
    • Constants which are truncated and an warning may be raised:

      Example, ASR.B D1 , opr24(var3) ,(oprs9(0x3E8), Y)

      The number 0x3E8 doesn’t fit into 9-bit field. This value is truncated to 0xE8

    • Constants which can’t be adapted to the wished addressing mode (selected by the enforce operator) and the compiler raise an error. Here we have 2 special cases:
      • sxe4

        Example, ADD D1, #sxe4i(-7)

      • Unsigned operators

        Example, ADD D2, (opru4(-6), X)

  2. Immediate forced to wrong size. In this case the compiler exits with an error. Example,
     LD D7, #opr8i(0x500)
  3. Variable address forced to unaccepted addressing mode for that instruction. This case also ends with a compiler error.Example,
     ADD D2, opr24a(var)
  4. Shift instructions – when the number of bit positions to shift the operand is forced to #sxe4i(value). This addressing mode is accepted, but is transformed into #imm5i according to the architecture manual. Example,
     ASL.B D3 , (-X)  ,#sxe4i(2) is transformed in the compiler into
     ASL.B D3 , (-X)  ,#opr5i(2)