CS 208 s21 — Learning Block #14
Table of Contents
1 Exercise
Top of the stack at 0x200
, 8 bytes stored there contain 0x20
. What changes about registers or memory as a result of popq %r8
?1
2 Practice
CSPP practice problem 3.32 (p. 244)
3 Work on Lab 2
Footnotes:
1
popq
copies the top 8 bytes of the stack to %r8
, so %r8
will now contain 0x20
.
This also "pops" these 8 bytes off the stack, so 8 is added to %rsp
, making it 0x208
(remember, the stack grows down to lower memory addresses, so moving %rsp
up in memory shrinks the stack).
Nothing changes in terms of values stored in memory — %rsp
tracks the top of the stack, but the system doesn't zero-out popped values or anything like that.