MB95630H Series
MN702-00009-1v0-E
FUJITSU SEMICONDUCTOR LIMITED
13
CHAPTER 2 CPU
2.3 Placement of 16-bit Data in Memory
2.3
Placement of 16-bit Data in Memory
This section describes how 16-bit data is stored in memory.
■
Placement of 16-bit Data in Memory
●
State of 16-bit data stored in RAM
When 16-bit data is written to memory, the upper byte of the data is stored at a smaller address
and the lower byte is stored at the next address. When 16-bit data is read, it is handled in the
same way.
Figure 2.3-1 shows how 16-bit data is placed in memory.
Figure 2.3-1 Placement of 16-bit Data in Memory
●
Storage state of 16-bit data specified by an operand
Even when the operand in an instruction specifies 16-bit data, the upper byte is stored at the
address closer to the op-code (instruction) and the lower byte is stored at the address next to the
one at which the upper byte is stored.
That is true whether an operand is either a memory address or 16-bit immediate data.
Figure 2.3-2 shows how 16-bit data in an instruction is placed.
Figure 2.3-2 Placement of 16-bit Data in Instruction
●
Storage state of 16-bit data in the stack
When 16-bit register data is saved in a stack on an interrupt, the upper byte is stored at a lower
address in the same way as 16-bit data specified by an operand.
Before
exec
u
tion
Memory
Memory
A
0x12
3
4
MOVW 0091H, A
0x0090
0x0091
0x0092
0x009
3
0x0090
0x0091
0x0092
0x009
3
0x12
0x
3
4
A
0x12
3
4
After
exec
u
tion
Extended
a
ddre
ss
16-
b
it immedi
a
te d
a
t
a
;
;
A
ss
em
b
le
Extended
a
ddre
ss
16-
b
it immedi
a
te d
a
t
a
;
;
[Ex
a
mple]
MOV A, 567
8
H
MOVW A, #12
3
4H
XX XX
60 56 7
8
E4 12
3
4
XX
0xXXX0
0xXXX2
0xXXX5
0xXXX
8