10.1 Assemblers Flashcards

1
Q

What is an assember?

A

Translates assembly (abstracted ISA) into machine code

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

What is assembly?

A

Writing programs specific for an ISA using mnemonics

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

What are mnemonics

A
  • Using short words to describe 1s and 0s operations in the ISA
  • A lookup table is used to translate mnemonics to opcodes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a lexer (and what does it do)

A
  • A lexer turns the source program into a set of tokens.
  • A token could be the opcode, operand etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between an assembler and a compiler?

A

Assembler: Converts assembly to machine code
Compiler: Converts higher level program to machine code

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

What types of convenient notations do assemblers typically allow for

A
  • Labels: Reference next line number
  • Named Constants: Can just be replaced with value
  • Variables: Can be changed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the format for Hex 8 assembly

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

How do Labels work in Hex 8 assembly

A
  • Refers to next line
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the hex-8 assembler accomodate for large operands

A
  • Inserts PFIX instructions automatically
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the DATA keyword do in hex-8 assembly?

A
  • Inserts that amount of data into the instruction stream (ie makes room for that many bits in memory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why does an assember run 2 passes, and what does it do on each pass?

A
  1. Resolve labels and symbols
  2. Construct binary

Note: no need to hold entire program in memory

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

What is backpatching

A

Used to assemble in one pass.
Fixes up labels afterwards.

Downsides: need to store entire program in memory (may be a problem for embedded devices)

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