Systems Architecture Flashcards
(38 cards)
Does ARM assembly support a RISC or CISC instruction set?
RISC
What is the purpose of the CPSR?
To record anomalous arithmetic outputs
What are the flags for the CPSR?
N bit for negatives
Z bit for zero results
C bit for a carry
V bit for negatives
Which registers can the programmers us?
R0-R7
Which register should contain the output of a function?
R0
What is an unaligned transfer?
Reading 4 bytes across more than one 4 byte region
What does the stack store?
Variables and function arguments
What does the heap store?
Data allocation during runtime
What does the global data area store?
Global variables
What does BSS store?
Uninitliased global variables
What does the text segment store?
Machine code instructions
Define pipelining
A method to improve efficiency where multiple fetch-decode-execute cycles are run at the same time with each using a different component
Define program relative addressing
An addressing mode where an isntruction specifies an address relative to the current program counter
What is the effective address?
The PC + an offset
What does a compare instruction do?
Updates and evaluates the value of the bits in the CPSR and then discards them
What should we always ensure when returning from a function?
LEAVE NO TRACE
What is the first convention for writing good functions?
We should only use r0-r3 to pass parameters to functions
What do you do if you have more than 4 parameters to pass to a function?
Allocate memory from the heap to a pointer and then store those pointers in r0-r3
What does the link register store?
The return address
What should we do to the stack pointer when we call a function to ensure we have enough memory?
Decrement the value of the stack pointer so that the stack grows into the unused memory space
What is the second convention for writing good functions?
We must preserve the contents of registers
What does it mean to preserve registers?
Registers must be restored after a procedure call and if we avoid using these regsiters than we avoid register spilling
What is register spilling?
The contents of registers spilling into main memory
What is the third convention for writing good functions?
Push contents of registers to the stack before your function and pop them afterwards to restore them