week 7 assembly language Flashcards
Machine Language
Bit patterns that are directly executable by computer.
Instructions that the CPU can understand
Assembly Language
Symbolic representation of machine language.
Instructions are written in mnemonic ASCII
Only readable for humans
Assembler
used to translate assembly program (.ASM) into machine code (.OBJ)
Linking
Process of connecting several .OBJ files together into one executable program.
Programming
Process f designing/writing/testing/debugging/maintaining the source code of computer programs.
Variables
places to store information
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
a function in a high level language
a group of instructions meant to perform a specific task like square a number
Pointers
variable storing a memory address
Dereferencing
act of using the memory address held onto 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
what i need to write if/else statement in assembly
- loading constants
- arithmetic
- compare
- branch
- basic jump instruction
- labeling in assembly
what i need to write a subroutine
- .FALIGN
- Labels
- JSR
- RET
- assembly directives
What i need to access data memory?
- LDR
- STR
- pointer
- for loop
How does an assembler program operates?
- first phase: converts labels into offsets and removes comments
- second phase: converts assembly code into machine code with ISA and save it to an object file (.OBJ)
- Then when this code finishes, a “loader” program loads it into computer’s memory.
what are 2 regions in the LC4 memory
- User region:
- programs run by users like 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 OC mode with PSR[15] = 1
- Address x8200 first address of your OS
.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