This chapter describes the expressions of instruction that represents the variable content such as register names, program labels, and expressions.
The following table lists the symbols & notations with their descriptions:
| Expression | Description |
|---|---|
| bwplbwpl | Any of the characters B, W, P, L, or 2-letter pairs BB, BW, BP, BL, WB, WW.... LB, LW, LP, or LL to indicate the sizes for an instruction with two input operands. B=byte, W=16-bit word, P=24-bit pointer, L=32-bit long-word. The two-letter codes allow the size of each operand to be specified separately and the one-letter codes indicate the same size is used for both input operands. |
| bwl | Any of the characters B, W, or L to indicate the size of the operation. B=byte, W=16-bit word, L=32-bit long-word |
| bwpl | Any of the characters B, W, P, or L to indicate the size of the operation. B=byte, W=16-bit word, P=24-bit pointer, L=32-bit long-word |
| cc | Branching condition ( EQ, NE, MI, PL, GT, or LE) for loop instructions test-and branch (TBcc) or decrement and branch (DBcc). Branch if... EQ - equal; NE - not equal; MI - minus; PL - plus; GT - greater than; LE - less than or equal |
| cpureg | Any of the CPU registers D0, D1, D2, D3, D4, D5, D6, D7, X, Y, SP, CCH, CCL, or CCW. Used for transfer and exchange instructions. |
| Di | Any of the eight CPU data registers D2, D3, D4, D5, D0, D1, D6, or D7. |
| Dj | Typically used for a second operand. |
| Dk | Used for a third operand in MAC, MOD, MUL, and DIV instructions. |
| Ds | Used for a source operand. |
| Dd | Used for a destination operand. |
| Dn | Used for a numeric control parameter such as the number of positions to shift. |
| Dp | Any of the four 16-bit CPU data registers D2, D3, D4, or D5. Used to specify the width and offset parameters in bit field instructions BFEXT and BFINS. |
| opr1i opr5i | Any label or expression that evaluates to a 1-bit (5-bit) immediate operand. Used to specify number of shifts for shift and rotate instructions. Immedaiate value is encoded in the shift postbytes (sb) or (sb+xb). |
| opr8i | Any label or expression that evaluates to an 8-bit immediate operand. |
| opr16i | Any label or expression that evaluates to a 16-bit immediate operand. |
| opr18i | Any label or expression that evaluates to an 18-bit immediate operand. Two bits of the 18-bit operand are encoded into the opcode. The value is zero-extended and placed in X or Y. |
| opr24 | A 24-bit address which can be considered signed or unsigned. |
| opr24a | A 24-bit address. |
| opr24i | A 24-bit immediate constant. |
| opr24u | A 24-bit unsigned constant offset. |
| opr32i | Any label or expression that evaluates to a 32-bit immediate operand. |
| oprdest | Any label or expression that evaluates to an address within +127/-128 or +/-16K from the current location. Used for 7-bit or 15-bit relative branches. |
| oprimmsz | Any label or expression that evaluates to an immediate operand of the same size as the CPU register involved in the instruction (8, 16, or 32 bits). |
| Operators | |
| oprmemreg | Refer to the CPUS12Z Reference Manual for the OPR addressing summary to see how to expand this into the operand specification for 1 of 16 OPR addressing modes (allowed forms and brief description shown here below). |
| #oprsxe4i | Short Immediate. oprsxe4i is any label or expression which evaluates to one of the values -1, 1, 2, 3...14, or 15. Auto sign-extended to 8, 16, 24, or 32 bits. |
| Di | Register as operand. Di is any one of the eight CPU data registers D0, D1, D2, D3, D4, D5, D6, or D7. |
| (opru4,xys) | Short offset (0-15) from X, Y, or S. opru4 is any label or expression that evaluates to unsigned 0-15. |
| (+xy) | (xy+) | (-xy) | (xy-) | (-S) | (S+) | Auto pre/post inc/dec from X, Y, or S (S=SP).Where xy is either of the two index register names X or Y. |
| (Di,xys) | Register offset from X, Y, or S. xys is any one of the 24-bit indexing registers X, Y, or S (S=SP). 16-bit D2, D3, D4, D5 treated as signed, D0, D1, D6, D7 treated as unsigned. |
| [Di,xy] | Register offset from X or Y Indirect. D2, D3, D4, D5 treated as signed, D0, D1, D6, D7 are unsigned. |
| (oprs9,xysp) | 9-bit signed offset from X, Y, S, or P. oprs9 is any label or expression that evaluates to a 9-bit signed value from -256 to +256. (0 is treated as +256) xysp is any one of the 24-bit registers X, Y, S or P ( S=SPP=PC). |
| [oprs9,xysp] | 9-bit signed offset from X, Y, S, or P Indirect. |
| opru14 | Short Extended (16K). |