|
|
|
| Table 1.10 Instruction set mnemonic elements. |
| | Mnemonic | Operation | | ADD | Addition | | SUB | Subtraction | | MPY | Multiplication | | DIV | Division | | INC | Increment | | DEC | Decrement | | CMP | Compare | | MOVE | Decimal (.P) or Character (.C) Move | | CLR | Clear (a register) | | LD | Load (a register from memory) | | ST | Store (a register to memory) | | LDA | Load address (generated by instr) into register | | LDM | Load multiple registers | | STM | Store multiple registers | | MOVE | Move (register to register or memory to memory) | | SHL | Shift Left | | SHR | Shift Right | | BR | Unconditional Branch | | BC | Conditional Branch | | BAL | Branch and Link | | BALR | Branch to Register and Link |
|
|
|
|
|
|
merely indicate some of the generic operations used throughout the text and provide a general framework. |
|
|
|
|
|
|
|
|
Many commercial assemblers allow the programmer to specify the operand, and the assembler infers the data type from its knowledge of the operands. Thus, if the location someLoc were defined to be a double-precision floating-point value, then the instruction LD R15, someLoc would generate the identical code as LD.D R15, someLoc. Additionally, when there is no explicit type information in the instruction, as in MPY R2, R14, R4, the assembler assumes that the data type is a standard machine word, and thus the instruction generated is the same as MPY.W R2, R14, R4. In this book, the goal is clarity, and thus a formal data type is usually appended to the operation mnemonic. |
|
|
|
|
|
|
|
|
Register usage is clear from contexta binary operation (such as addition) is a three-operand instruction if there are three operands, a two-operand instruction if there are two operands, and similarly for unary operations. The first register (or memory address) specified is the destination; this reflects the similarity with algebraic notation. Thus, the instructions specified by DIV.WA, B would generate the result A = A DIV B, and those specified by NOT.W A, B would generate the result A = NOT B. These conventions are summarized in Table 1.13. |
|
|
|
|
|