Module 7: Assembly Language Flashcards
machine language
bit patterns that are directly executable by the computer
- -may look like gibberish to humans but it is actually the binary encoded instructions that the CPU can understand
- -may also contain data in addition to instructions
assembly language
symbolic representation of machine langauge
- -instructions as mnemonic ASCII strings
- -cannot run but mostly readable by humans
- -can be handwritten or produced by a compiler from a high level language like C
- -assembly files can also contain ASCII lables (e.g. BRnzp LOOP)
assembler
used to translate assembly programs (.ASM) into machine code (.OBJ)
linking
process of connecting several .OBJ files together into one executable program
programming
process of designing/writing/testing/debugging/maintaining the “source code” of computer programs
variables
places to “store” information as in algebra
loops
a way to “repeat” a portion of a program over and over again
conditional control
a way for our program to change the natural flow of a program based on a condition
subroutine
group of instructions meant to perform a specific task e.g. square a number, print out a string, etc. in assembly; similar to a “function” in a high level language
pointers
variable storing a memory address (as opposed to a regular variable that holds data)
dereferencing
act of using memory address held by a pointer to read/write from the memory location held onto by that pointer
assembly directives
provide an indication to the assembler of where it should place various blocks of code or data
Loops & if-else statements
covers: loading constants, arithmetic, compare, branch, basic jump instructions, labeling in assembling
subroutines
covers: JSR, RET, labels, assembly directives: .FALIGN
accessing data memory
covers: LDR, STR, what is a pointer?, for loops
an “assembler” program
operates in two phases:
- converts labels into offsets and removes comments
- converts assembly code into machine code
- -uses ISA to do this and saves in a .OBJ file
Loader
after assembler finishes a “loader” program loads it into computer memory
LC4 memory
user region
- programs run by users e.g. MS Word
- processes run in user mode with PSR[15]=0 are not allowed to access OS locations in the memory
OS region
- processes run in OS mode with PSR[15]=1
- note: address x8200, first address of your OS
LC4 assembly directives
.DATA
-next values are in DATA memory
.ADDR
-set current address to the specified value
.FILL IMM16
-set value at the current address to the specified 16-bit value
ultimately, the assembly program gets assembled to an object file that is a specification for how the machine memory should be set up