Texas Instruments MSP430x1xx User Manual
Page 59

RAM and Peripheral Organization
4-7
Memory
In the following examples, word-to-word and byte-to-byte operations show the
results of the operation and the status bit information.
Example Word-Word Operation
Example Byte-Byte Operation
R5 = 0F28Eh
R5 = 0223h
EDE .EQU 0212h
EDE .EQU 0202h
Mem(0F28Eh) = 0FFFEh
Mem(0223h) = 05Fh
Mem(0212h) = 00112h
Mem(0202h) = 043h
ADD @R5,&EDE
ADD.B @R5,&EDE
Mem(0212h) = 00110h
Mem(0202h) = 0A2h
C = 1, Z = 0, N = 0
C = 0, Z = 0, N = 1
Figure 4–6 shows the register-byte and byte-register operations.
Figure 4–6. Register
-Byte/Byte-Register Operations
Unused
High Byte
Low Byte
Byte
Register-Byte Operation
0h
High Byte
Low Byte
Byte
Byte-Register Operation
Register
Memory
Register
Memory
The following examples describe the register-byte and byte-register
operations.
Example Register-Byte Operation Example Byte-Register Operation
R5 = 0A28Fh
R5 = 01202h
R6 = 0203h
R6 = 0223h
Mem(0203h) = 012h
Mem(0223h) = 05Fh
ADD.B
R5,0(R6)
ADD.B @R6,R5
08Fh
05Fh
+ 012h
+ 002h
;Low byte of R5
0A1h
00061h
;–>Store into R5
;High byte is 0
Mem (0203h) = 0A1h
R5 = 00061h
C = 0, Z = 0, N = 1
C = 0, Z = 0, N = 0
(Low byte of register)
(Addressed byte)
+ (Addressed byte)
+ (Low byte of register)
–>(Addressed byte)
–>(Low byte of register,
zero to High byte)