CPU Registers
4-11
16-Bit MSP430X CPU
4.3.4
The Constant Generator Registers CG1 and CG2
Six commonly used constants are generated with the constant generator
registers R2 (CG1) and R3 (CG2), without requiring an additional 16-bit word
of program code. The constants are selected with the source register
addressing modes (As), as described in Table 4−2.
Table 4−2. Values of Constant Generators CG1, CG2
Register
As
Constant
Remarks
R2
00
-
Register mode
R2
01
(0)
Absolute address mode
R2
10
00004h
+4, bit processing
R2
11
00008h
+8, bit processing
R3
00
00000h
0, word processing
R3
01
00001h
+1
R3
10
00002h
+2, bit processing
R3
11
FFh, FFFFh, FFFFFh
-1, word processing
The constant generator advantages are:
-
No special instructions required
-
No additional code word for the six constants
-
No code memory access required to retrieve the constant
The assembler uses the constant generator automatically if one of the six
constants is used as an immediate source operand. Registers R2 and R3,
used in the constant mode, cannot be addressed explicitly; they act as
source-only registers.
Constant Generator − Expanded Instruction Set
The RISC instruction set of the MSP430 has only 27 instructions. However, the
constant generator allows the MSP430 assembler to support 24 additional,
emulated instructions. For example, the single-operand instruction:
CLR
dst
is emulated by the double-operand instruction with the same length:
MOV
R3,dst
where the #0 is replaced by the assembler, and R3 is used with As=00.
INC
dst
is replaced by:
ADD
0(R3),dst
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...