4.4 - Programming Lanhuage Translators Flashcards

1
Q

What does an assembler do?

A

Translates assembly language into machine code
One assembly code instruction into one machine code instruction

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

What is source code?

A

The input code for the assembler

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

What is object code?

A

The output produced by the assembler
Can be saved and run whenever needed

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

What are the uses of assembly code?

A

Used when a program needs to execute as fast as possible, occupy as little space as possible or manipulate individual bits and bytes
Object code rather than source code is saved

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

What is the input and output for compilers?

A

Input = source code
Output = object code (executable machine code)

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

What are the phases a compiler goes through?

A
  • lexical analysis
  • syntactic analysis
  • semantic analysis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the compilation process of compilers?

A
  • produces intermediate code, optimises it then generates machine code
  • won’t generate any machine code if there are errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is relocatable code?

A

Code produced when any errors in the code are corrected

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

Advantages of a compiler?

A
  • once program is compiled, object code can be distributed and compiler isn’t needed
  • object code runs faster than interpreted code
  • object code is more secure as machine code cannot be easily read or copied by someone wishing to modify the code and sell it as their own
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does an interpreter do?

A

Translates high-level instructions into intermediate form, which it then executes
No object code is produced
Scans through a program and reports syntax errors

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

Advantages of an interpreter?

A
  • useful in education as students can program interactively
  • useful during development when a programmer wants to test a small piece of code without compiling the whole program
  • available for high level code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is byte code?

A

Used by some compilers compile the soup

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