Module 9: Intro to C Flashcards
Machine Code
binary files
Assembly Code
text files (.asm)
C code
text files (.c, .h)
Compiler
converts a high level language (like C) to low level language (assembly) for example .c to .asm
Assembler
converts assembly language to machine language object files (.asm to .obj)
Linker
combines multiple object files (.obj) into a single executable object file; e.g. user_program + os.obj –> my_program.obj
symbol table
created by a compiler to keep track of where data should be stored, the type of data stored, and the scope of the data being stored by the program it compiled
local variables
the “scope” of these variables only exist within the {}. Variables must be declared at the top of the block!
stack
in the context of the C language, the region in data memory where data required to support functions in the C language will be stored (functions such as arguments, local variables, and return values). it is organized like a physical stack: imagine piling one book on top of the next one in a stack of books. this is why it grows “backwards” in memory
frame
logical grouping of the data on the stack that belongs to a single function. examples of data in the stack are arguments, local variables, and return values. as one function calls another each function will have its own frame.
frame pointer
a register that holds a starting address for the frame or in the case of the LC4, a register holding the location where the calling function’s frame pointer was stored in the active function’s stack frame. sometimes called the base pointer.
return address
address in program memory to return after function completes
prologue
assembly code created by the compiler to construct the frame for any given function. it is the first code executed when a function is called. it is also responsible for “pushing” the stack frame for the active function onto the stack.
epilogue
assembly code created by the compiler to “pop” the stack from the active function off of the stack. it copies the return value into the proper location on the stack so that the calling function has access to the returning data (if any) from the active function. it is executed every time a function exits.
Big Ideas in C
a high level/low level language that binds the gap between a machine level language and high level languages
imperative
procedural
file-oriented (files: a simple abstraction for permanent storage and I/0)
portability: the same C code can be compiled for different ISAs