3/24/97 4-15 CPU Organization
The POP operation copies the data at the top of the stack and then adds two to the stack pointer,
as follows shown in Figure 4.11.
All stack pushes and pops occur in word multiples. If a byte quantity is pushed on the stack it is
stored as the least significant byte of a word and the high byte is left unwritten;
see Figure 4.12. A POP to a byte register removes a word from the stack and the byte register
receives the least significant 8 bits of the word, as shown in Figure 4.13.
Figure 4.10 PUSH operation
Figure 4.11 POP operation
Figure 4.12 POP a byte
before
after
SP
12
SP
MOV R0,#1234h
PUSH R0
34
(empty)
(empty)
(empty)
(empty)
(empty)
2n + 6
existing data existing data
2n + 4
2n + 2
....
2n + 6
2n + 4
2n + 2
....
before after
AA
SP
POP R1
55
(empty)
(empty)
2n + 6
2n + 4
2n + 2
....
AA
SP
55
(empty)
(empty)
2n + 6
2n + 4
2n + 2
....
R1 = AA55h
before
after
AA
SP
POP R1H
55
(empty)
(empty)
2n + 6
2n + 4
2n + 2
....
AA
SP
55
(empty)
(empty)
2n + 6
2n + 4
2n + 2
....
R1 = 5569h
MOV R1,#6869h