CSO EXAM FINAL 2025
QUESTIONS AND ANSWERS
Memory is not.... - ✔✔unbounded - must be allocated and managed
We say that the memory is designed such that each byte has an address. Why don't we
simplify the memory design and give one address to every 4 bytes for example? Just
answer with a sentence or two. - ✔✔Provides greater flexibility and control, as it allows
us to manipulate the smallest unit of data, including small data types.
You would waste space and have limited data access otherwise since you can only read
data in chunks of 4 bytes at a time, therefore you can't work with smaller data types like
chars that are 1 byte
How does the CPU and memory interact with each other? - ✔✔CPU sends addresses to
memory,
Memory and CPU send data and instructions to each other
What are the types/purpose of assembly operations? - ✔✔Perform arithmetic, transfer
data, transfer control
COPYRIGHT © 2025 BY OLIVIA WEST, ALL RIGHTS RESERVED 1
, What is the %rsp register? What does it contain/its initial value? - ✔✔stack pointer
register
contains the address for the top of the stack which is also the lowest address, the stack
grows down.
What is the %rip register - ✔✔contains the next instruction
What does the "ret" do - ✔✔return (control) to caller (function)
What two registers are modified when "call func" is used, and how are they modified -
✔✔%rip points to the next instruction
%rsp decreases to make room on the stack and pushes the return address of func onto
the stack
What is the %rax register - ✔✔return register
What does the callee do when it finishes? - ✔✔it writes the return value (if any) to %rax,
cleans up the stack, and use retq instruction to return control to the caller.
How do pushq and popq affect the rsp - ✔✔pushq decrements by 8 and adds to stack/
writes value at that address
popq increments by 8 and pops and sends value to Dest
Why is it necessary to give a data type when declaring a pointer? - ✔✔pointer
arithmetic and memory allocation/deallocation
COPYRIGHT © 2025 BY OLIVIA WEST, ALL RIGHTS RESERVED 2
QUESTIONS AND ANSWERS
Memory is not.... - ✔✔unbounded - must be allocated and managed
We say that the memory is designed such that each byte has an address. Why don't we
simplify the memory design and give one address to every 4 bytes for example? Just
answer with a sentence or two. - ✔✔Provides greater flexibility and control, as it allows
us to manipulate the smallest unit of data, including small data types.
You would waste space and have limited data access otherwise since you can only read
data in chunks of 4 bytes at a time, therefore you can't work with smaller data types like
chars that are 1 byte
How does the CPU and memory interact with each other? - ✔✔CPU sends addresses to
memory,
Memory and CPU send data and instructions to each other
What are the types/purpose of assembly operations? - ✔✔Perform arithmetic, transfer
data, transfer control
COPYRIGHT © 2025 BY OLIVIA WEST, ALL RIGHTS RESERVED 1
, What is the %rsp register? What does it contain/its initial value? - ✔✔stack pointer
register
contains the address for the top of the stack which is also the lowest address, the stack
grows down.
What is the %rip register - ✔✔contains the next instruction
What does the "ret" do - ✔✔return (control) to caller (function)
What two registers are modified when "call func" is used, and how are they modified -
✔✔%rip points to the next instruction
%rsp decreases to make room on the stack and pushes the return address of func onto
the stack
What is the %rax register - ✔✔return register
What does the callee do when it finishes? - ✔✔it writes the return value (if any) to %rax,
cleans up the stack, and use retq instruction to return control to the caller.
How do pushq and popq affect the rsp - ✔✔pushq decrements by 8 and adds to stack/
writes value at that address
popq increments by 8 and pops and sends value to Dest
Why is it necessary to give a data type when declaring a pointer? - ✔✔pointer
arithmetic and memory allocation/deallocation
COPYRIGHT © 2025 BY OLIVIA WEST, ALL RIGHTS RESERVED 2