Week 5 Flashcards

1
Q

Characteristics of HLL

A

One to many translation, hardware independent, application orientation, strongly omits hardware details, designed for programmer productivity, source code requiring translation is written in HLL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Characteristics of LLL

A

One to one translation, hardware dependent, systems programming orientation, few abstractions, special purpose, assembly code(LLL) is the result of translation by a compiler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Assembly Language

A
  1. Translated by an assembler
  2. Many assembly languages exist as it uses the instruction set and operands from a single processor, share the same fundamental structure.
  3. Programmer can switch between assembly languages quickly
  4. A single statement corresponds to a single machine instruction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Assembly Language Syntax

A

label: op result, operand1, operand2, … ; comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Label (Assembly Language)

A
  1. Symbolic for the memory address pointing to the location storing this instruction
  2. Optional label used for branching
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Op (Assembly Language)

A

Mnemonic for the operation to perform; one of the possible instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Operand (Assembly Language)

A

Specifies an operand for the instruction; usually a pointer or immediate value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Operand Order

A

Target register on the left, source register on the right

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Register Names

A

Example of naming register 10: $10, R10, r10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Memory Pointer Syntax

A

Example of loading a register (r2) from memory at the location pointed to by register r1: ldr r2, (r1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Operand Types

A

Immediate, Reference to register, Reference to memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Block Comment

A

Explain purpose of and detail register and memory use for a code section

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Line comment

A

Explain purpose of one instruction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Conditional Execution

A

Code that may or may not be executed depending on a certain condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Branch Instruction

A

if (expression) {
PC(Current Instruction ptr) + Offset: This is the branch target addy
else {
PC = PC + sizeof(instr.(usually 4 bytes))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Offset

A

Bytes between Branch instruction first byte and target instruction first byte

17
Q

Assembler

A

Translates assembly language programs into binary code for the processor to execute

18
Q

Assembler vs. Compiler

A

Similarities: Both translate a source program into equivalent binary code
Differences: Compiler has more freedom to choose which values are stored in registers and allocation of variables to memory, whereas an assembler is a one-to-one translation

19
Q

Two-pass Algorithm

A

Assembler follows this: First pass stores label names and its relative memory address in a symbol table; also stores locations for each statement. The second pass constructs machine code bit strings by using labels & locations calculated by first pass

20
Q

One-pass Algorithm

A

Compilers follow this: Compilation is intensive and declaring and defining is much more readable

21
Q

Fall through instruction

A

Default next instruction after a branch instruction

22
Q

Where is increment for a for loop in assembly

A

After the code that performs the body

23
Q

Overhead

A

Additional computational work that occurs due only to the use of a fixed iteration loop

24
Q

jsr

A

Saves the current location and branches to a subroutine at a specified location

25
Q

ret

A

Causes the processor to return to the previously saved location

26
Q

Amdahl’s Law

A

Speedup Overall = Original Execution Time / Execution time using enhancement

27
Q

fe

A

Fraction enhanced, the portion of the original execution sped up; 0 <= fe <= 1

28
Q

Se

A

Speedup when the enhancement is in use; Se = Time to execute fe without enhancement / Time to execute fe with use of enhancement

29
Q

Where is HLL in the compilation process?

A

source code requiring translation is written with HLL

30
Q

Where is assembly in the compilation process?

A

assembly code is the result of translation by COMPILER

31
Q

List 3 problems that occur from manual offset computation:

A

1) Programmer error in offset calculation breaks program
2) programmer deletes or inserts an instruction between branch and target (offset must be revised because number of bytes between branch and target has changed)
3) Programmer productivity and happiness decline

32
Q

knowing that jsr occupies locations 0x0C - 0x0F in memory, what is the sign magnitude decimal offset value and using it to go to label3, if label3 occupies locations 0x18 - 0x1B?

A

+12 (Week 5 slide 27 for more examples)

33
Q

Two-pass makes _____ references

A

forward references (undefined references), not an error; they resolve eventually

34
Q

assembly branches when previous compare is _____

A

false

35
Q

How do you fetch sequentially next fast?

A

1) Dedicate hardware outside the ALU to speed the computation of the pointer to the most common next machine instruction, call it the Default Next Instruction Pointer
2) Design the Default_Next_Instruction_Pointer circuit for a processor with a 4-byte, fixed-length machine instruction format