Computer Systems - Programming Languages Flashcards

1
Q

What are the types of translators to translate source code to machine code?

A

Compiler
Interpreter

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

How does an interpreter work?

A

It reads the code, interpreting it one line at a time into machine code.
If there is a syntax error the program will stop running and an error will be shown.

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

What are the advantages of an interpreter?

A

If there is a syntax error the program will stop running and an error will be shown, making debugging easier.

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

What are the disadvantages of an interpreter?

A

Slower

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

How does a compiler work?

A

It translates the source code into machine code in one go, before executing the program.

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

What are the advantages of a compiler?

A

Produces ready-to-use executable machine code

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

What are the disadvantages of a compiler?

A

Any changes to the code require it to be converted again.
Any errors will generally crash the program

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

What is the byte code?

A

It is created and compiled as an intermediate step between the source and machine code.
It allows for programs to be interpreted as and when they are needed.
It is interpreted according to the architecture of the machine the program is run on.

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

What are opcodes?

A

Commands, eg. LDA, ADD

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

What are operands?

A

The values, eg. A, 14

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

What is pseudo code?

A

Instructions written as a logical sequence of steps

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

What is assembly language?

A

A system of opcodes and operands based on binary codes.
The opcodes are assigned 3 letter mnemonics and the operands are the decimal or hexadecimal values

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

What is an assembler?

A

Translates assembly code into machine code.

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

What is a high-level language?

A

A computer language that is closer to a real language than to machine code

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

What are the advantages of a high-level language?

A

Easy to learn
Faster to read and write
Easier to understand, debug and maintain

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

What are the disadvantages of high-level languages?

A

Slower
Less efficient
Less precise
Less reliable

17
Q

What are low-level languages?

A

Languages that are closer to the hardware.

18
Q

What are the advantages of low-level languages?

A

Faster
More efficient
Execute directly on your hardware
More control

19
Q

What are the disadvantages of low-level languages?

A

Hard to read and write
Harder to debug
More timely
Less compatible