Exam 1 Flashcards
instruction
A single command to a computer
Machine language
binary coding of isntructions
Each ISA…
has a fixed set of instructions that the CPU can read
Assembly Language (asm)
human readable textual representation of machine language
almost one to one
CPU can…
Read a list of instructions
Turing complete (solve any computationally solvable problem)
CPU _____
Ram _______
Does, remembers
Registers
small, fast, temp memory inside CPU
The CPU can only…
operate on data in registers
run programs in memory
MIPS has…
32 registers
Arguments
a registers
inputs to a function
Return Values
v registers
returns from function
used for syscall
Temporaries
t registers
Saved (stack)
s registers
SAFE PLACE
Zero
register that always contains zero
Load
put value into a register
immediate
a constant value written inside the instruction
Load into _____
Store into ______
register, variable
Variables are in …
memory
Load into …
register
Store into …
memory
Every variable
has 2 parts (address and value)
Loads copy data from…
memory into CPU registers
Stores copy data from…
CPU registers into memory
Address of any value
is the address of its 1st byte
When you assemble…
All labels dissapear
BEQ
Equal to
BNE
Not equal
BLT
Less than
BLE
Less than or equal too
BGT
Greater than
BGE
Greater than or equal too
Arrays
all equidistant
all contiguous (nothing between them)
each variable is the same type and size
Memory Alignment
means the address of an n-byte value must be a multiple of n
(memory accesses faster)
Endianness
what rule is used to decide which byte goes first
Little-Endian
CPU swaps the order of the bytes
Big-Endian
CPU keeps terms in order
Function
named piece of code with inputs and outputs
Function call
pauses the caller and runs the callee to completion
Call graph
diagram of which one function calls one another
Function return
Stops running callee and resumes caller
Leaf function
Function that calls no function
Program counter
PC is the address of the current instruction
All functions
share the registers
Call Stack
stores info about function calls
region of memory, each program gets when it starts
Stack accessed through stack pointer
Push
putting something at the top of the stack (A,B,C)
Pop
Taking something from the stack (C,B,A)
Activation Records
saved copies of registers values that we want to get back later
Stack ____ when called
grows
Stack ____ when returned
shrinks
Recursive function
each function call gets its own variables
Every function
is free to change any register at any time