Program Construction Flashcards

1
Q

Machine Code

A

The CPU can only understand machine code, it is made up of coded instructions and data

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

Assembly Language

A

This language has a small set of commands which represent certain pieces of machine code. This helped programmers as they didn’t have to remember sets of binary code, instead they learnt commands.

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

High Level Languages

A

Its purpose is to be easier to write and still be easily translated into machine code so that it can be processed by the CPU.

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

Features of high level language

A

Each line of code translates into multiple lines of machine code, Does not give direct access to registers or other CPU features, Instructions are semantic and do not reflect the design of the processor.

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

Features of low level language

A

Each line of code translates into a single line of machine code, Allowing the developer to manipulate registers and the CPU directly, Instructions are directly linked with the instruction set of the processor and are based on the design of the processor.

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

Compiler

A

Converts the whole code into one file

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

Interpreter

A

Converts the source code into machine code 1 line at a time.

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

Assembler

A

It converts mnemonic assembly language instructions into machine code.

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

Lexical analysis

A

Comments and whitespace are removed from the source code. The high-level code is then converted into tokens.
Using the tokens, a symbol table would be produced containing all of the program key words and identifiers and their relative data types and memory locations for variables.

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

Syntax analysis

A

Check that the way the tokens are arranged makes sense in the grammar of the language.

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

Semantic analysis

A

Check whether the tokens themselves make sense.

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

Code generation

A

Producing machine code and storing it as an object file. Allocating memory locations to variables and constants. Working out relative addresses and adjusting the machine code appropriately.

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