The Stack Flashcards
ARMv8 uses ______ addresses
64-bit
The ARMv8 can address ____ bytes of memory
2^64
The virtual memory space is mapped to physical memory by __ and ________
OS and Hardware
A register can be loaded with _,_,_ or _ byte data from RAM Where is data placed? If necessary, higher order bits are?
1,2,4, and 8 Data is placed into the lower-order bits Sign-extended if loading signed data (1 or 0) Zero-extended if loading unsigned data (0 only)
Which kind of data can be stored into RAM?
byte, halfword, word, or doubleword Low-order bit of a register when the data is just a part of a register
Which part of a register can be stored in RAM when the data is just a part of the register?
Low-order bit (Right most bit) of a register
What is stack memory?
It is the space in RAM provided by the OS to store data for functions
What happens when a function is called?
A stack frame is pushed onto the stack which holds the function’s parameters, local variables, local variables, and return values The frame is popped when the function returns
The stack uses ____ memory
high
The stack grows _________
backwards (toward 0) low OS Program
Where are programs loaded?
Into low memory, right above the space reserved for the OS
The ____ is used for dynamically allocated memory in a program It is Done in C using ______( ) and ______( )
heap malloc freeze
Where does the SP register point and what happens to it when the stack grows?
Points to the top of the stack Is decremented when the stack grows
How is stack memory allocated by a program?
sub sp,sp,16 16 is the bytes needed
Why should the stack be quadword aligned?
The address in SP must be evenly divisible by 16 May need to allocate more space than actually needed