CPU Registers
4-5
16-Bit MSP430X CPU
4.3
CPU Registers
The CPU incorporates sixteen registers R0 to R15. Registers R0, R1, R2, and
R3 have dedicated functions. R4 to R15 are working registers for general use.
4.3.1
The Program Counter PC
The 20-bit program counter (PC/R0) points to the next instruction to be
executed. Each instruction uses an even number of bytes (two, four, six or
eight bytes), and the PC is incremented accordingly. Instruction accesses are
performed on word boundaries, and the PC is aligned to even addresses.
Figure 4−3 shows the program counter.
Figure 4−3. Program Counter PC
0
Program Counter Bits 19 to 1
19
15
1
0
16
The PC can be addressed with all instructions and addressing modes. A few
examples:
MOV.W #LABEL,PC ; Branch to address LABEL (lower 64 KB)
MOVA
#LABEL,PC ; Branch to address LABEL (1MB memory)
MOV.W LABEL,PC
; Branch to address in word LABEL
; (lower 64 KB)
MOV.W @R14,PC
; Branch indirect to address in
; R14 (lower 64 KB)
ADDA
#4,PC
; Skip two words (1 MB memory)
The BR and CALL instructions reset the upper four PC bits to 0. Only
addresses in the lower 64-KB address range can be reached with the BR or
CALL instruction. When branching or calling, addresses beyond the lower
64-KB range can only be reached using the BRA or CALLA instructions. Also,
any instruction to directly modify the PC does so according to the used
addressing mode. For example,
MOV.W #value,PC
will clear the upper four
bits of the PC because it is a
.W
instruction.
Содержание 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 ...