Assignment rules

An assembler assignment is an arithmetic assignment, a bit assignment, or a character assignment.

  • Arithmetic assignments are padded (usually with zeros) and truncated on the left. If the source has a type of F or H, the arithmetic statement is padded with sign bits.
  • Bit assignments are padded (with zeros) and truncated on the right.
  • Character assignments are padded (with blanks) and truncated on the right.

The following table shows how the assignment type is determined from the source and receiver data types. In this table, the following definitions are used:

?
Indicates an unknown type, for example, R1->+2.
*
Indicates any type or length.
Arithmetic
Indicates an arithmetic assignment. Padding is on left with sign bits.
Bit
Indicates a string assignment padded with zeros.
Character
Indicates a string assignment padded with blanks.
Hex Float
Hexadecimal floating point assignment.
String assignment
The number of bytes that correspond to the Min(receiver length, source length) are moved from the source to the receiver. If the receiver length is larger, it is padded. If the source length is larger, it is truncated. All padding and truncation is done on the right.
Move
The number of bytes that correspond to the receiver length are moved directly into the receiver location.
Error
Statement that is flagged as not valid.
Table 1. Assignment rules depending on the source and receiver type
Receiver Source Assignment type Pad or Truncate
Type Length Type Length
* 1 – * ? ? Move None
F, H, A, Y 1 – 4 F, H, A, Y, X, B, C 1 – 4 Arithmetic Left
E, D, L 4, 8, 16 Hex Float Right - 0
P, Z 1 – * Arithmetic  
X, B, C >4 Error  
Other Other Error  
X 1 – 4 F, H, A, Y 1 – 4 Arithmetic Left
P, Z 1 – * Arithmetic  
1 – * X, B 1 – * Bit Right – 0
C Bit Right – 0
Other   Error  
C 1 – 4 F, H, A, Y 1 – 4 Arithmetic Left
P, Z 1 – * Arithmetic  
1 – * X, B 1 – * Bit Right – 0
C Character Right – blank
Other   Error  
P, Z 1 – * P, Z 1 – * Packed  
F, H, A, Y, X, B, C 1 – 4 Packed  
E, D, L 4, 8, 16 Hex Float Right - 0
E, D, L 4, 8, 16 X = Move None
E, D, L 4, 8, 16 Hex Float Right - 0
F, H, A, Y 1 - 4 Hex Float Right - 0
P, Z 1 - * Hex Float Right - 0
? 1 – 4 F, H, A, Y 1 – 4 Arithmetic Left
1 – * X, B, C 1 – * Bit Right – 0
All others Error