![](/images/new-backgrounds/1168369/16836949x1.webp)
CHAPTER 2 MEMORY SPACE
2.2.3Arrangement of 16-bit Data in Memory Space
The
■Arrangement of
As shown in Figure
Figure 2.2-5 Arrangement of 16-bit Data in Memory
Before execution MEMORY | After execution MEMORY | |||||||||||
|
|
|
|
| MOVW ABCDH, A |
|
|
| ||||
|
|
|
|
|
| |||||||
|
|
|
|
| ABCFH |
|
|
|
|
| ABCFH | |
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
|
|
|
A |
|
|
|
| ABCEH |
| A |
|
|
| 34H | ABCEH |
1234H |
|
|
| 1234H |
|
| ||||||
|
|
|
|
|
|
|
|
| ||||
|
|
| ABCDH |
|
|
| 12H | ABCDH | ||||
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
| ||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ABCCH |
|
|
|
|
| ABCCH | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
As when 16 bits are specified by the operand during the execution of an instruction, bytes are assumed to be upper and lower in the order of their proximity to the OP code. This applies when the operand indicates the memory address and
Figure 2.2-6 Arrangement of 16-bit Data during Instruction Execution
[Example]
:
.
MOV A, | 5678H | ; | Extended address | ||||
MOVWA, | #1234H | ; | |||||
: |
|
|
|
|
| ||
. |
|
|
|
|
| ||
|
|
|
|
| Assembled |
| |
: |
|
|
| ||||
|
|
|
|
| |||
. |
|
|
|
|
| ||
XXXXH | XX XX | ; | Extended address | ||||
XXXXH | 60 56 78 | ; | |||||
XXXXH | E4 12 34 |
|
| ||||
XXXXH | XX |
|
| ||||
: |
|
|
|
|
| ||
. |
|
|
|
|
|
The same may also apply to data saved in the stack by interrupts.
13