Week 5 Flashcards
Characteristics of HLL
One to many translation, hardware independent, application orientation, strongly omits hardware details, designed for programmer productivity, source code requiring translation is written in HLL
Characteristics of LLL
One to one translation, hardware dependent, systems programming orientation, few abstractions, special purpose, assembly code(LLL) is the result of translation by a compiler
Assembly Language
- Translated by an assembler
- Many assembly languages exist as it uses the instruction set and operands from a single processor, share the same fundamental structure.
- Programmer can switch between assembly languages quickly
- A single statement corresponds to a single machine instruction
Assembly Language Syntax
label: op result, operand1, operand2, … ; comment
Label (Assembly Language)
- Symbolic for the memory address pointing to the location storing this instruction
- Optional label used for branching
Op (Assembly Language)
Mnemonic for the operation to perform; one of the possible instructions
Operand (Assembly Language)
Specifies an operand for the instruction; usually a pointer or immediate value
Operand Order
Target register on the left, source register on the right
Register Names
Example of naming register 10: $10, R10, r10
Memory Pointer Syntax
Example of loading a register (r2) from memory at the location pointed to by register r1: ldr r2, (r1)
Operand Types
Immediate, Reference to register, Reference to memory
Block Comment
Explain purpose of and detail register and memory use for a code section
Line comment
Explain purpose of one instruction
Conditional Execution
Code that may or may not be executed depending on a certain condition
Branch Instruction
if (expression) {
PC(Current Instruction ptr) + Offset: This is the branch target addy
else {
PC = PC + sizeof(instr.(usually 4 bytes))