15
12
11
8
7
6
5
4
0
Op-code
Rsrc
Ad
B/W
As
Rdst
Source or Destination 15:0
Destination 15:0
MSP430 and MSP430X Instructions
141
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CPUX
4.5
MSP430 and MSP430X Instructions
MSP430 instructions are the 27 implemented instructions of the MSP430 CPU. These instructions are
used throughout the 1MB memory range unless their 16-bit capability is exceeded. The MSP430X
instructions are used when the addressing of the operands or the data length exceeds the 16-bit capability
of the MSP430 instructions.
There are 3 possibilities when choosing between an MSP430 and MSP430X instruction:
•
To use only the MSP430 instructions – The only exceptions are the CALLA and the RETA instruction.
This can be done if a few, simple rules are met:
–
Place all constants, variables, arrays, tables, and data in the lower 64KB. This allows the use of
MSP430 instructions with 16-bit addressing for all data accesses. No pointers with 20-bit addresses
are needed.
–
Place subroutine constants immediately after the subroutine code. This allows the use of the
symbolic addressing mode with its 16-bit index to reach addresses within the range of PC + 32KB.
•
To use only MSP430X instructions – The disadvantages of this method are the reduced speed due to
the additional CPU cycles and the increased program space due to the necessary extension word for
any double-operand instruction.
•
Use the best fitting instruction where needed.
lists and describes the MSP430 instructions, and
lists and describes the
MSP430X instructions.
4.5.1 MSP430 Instructions
The MSP430 instructions can be used, regardless if the program resides in the lower 64KB or beyond it.
The only exceptions are the instructions CALL and RET, which are limited to the lower 64KB address
range. CALLA and RETA instructions have been added to the MSP430X CPU to handle subroutines in the
entire address range with no code size overhead.
4.5.1.1
MSP430 Double-Operand (Format I) Instructions
shows the format of the MSP430 double-operand instructions. Source and destination words
are appended for the indexed, symbolic, absolute, and immediate modes.
lists the 12 MSP430
double-operand instructions.
Figure 4-22. MSP430 Double-Operand Instruction Format