Translators Flashcards

1
Q

Converting source code to machine code.

A

Translation

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

Why is translation needed?

A

Source code is easy to understand for us, however computers need it converted into pure binary to understand and execute. (machine code)

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

Types of translators:

A

• Assemblers
• Interpreters
• Compilers

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

Translators that translate source code

A

Interpreters and compilers

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

translates assembly code

A

assemblers

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

Won’t run unless all errors in the code are corrected

A

Compiler

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

Runs program partially if an error is present in the code

A

Interpreters

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

Takes one line of source code, translates it and executes it

A

interpreter

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

takes entire source code and translates it

A

compiler

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

Assembler description

A

• Translates assembly language into machine code.
• Takes basic commands and operators from assembly code and converts them into binary code that can be recognised by a specific type of processor
• The translation process: one-to-one from assembly code to machine code

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

Advantages of an assembler

A

• Programs written in machine language can be replaced with mnemonics, which are easier to remember
• Memory-efficient
• Speed of execution is faster
• Hardware-oriented
• Requires fewer instructions to accomplish the same result

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

Disadvantages of an assembler

A

•Long programs written in such languages cannot be executed on small computers
• It takes lot of time to code or write the program, as it is more complex in nature
• Difficult to remember the syntax
• Lack of portability between computers of different makes

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

• Translates source code from high-level languages into object code and then machine code to be processed by the CPU
• The whole program is translated into machine code before it is run

A

Compiler description

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

Advantages of a compiler

A

• No need for translated at run-time
• Speed if execution is faster
• Code is usually optimised
• Original source code is kept secret

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

Disadvantages of a compiler

A

• Source code is easier to write in a high-level language, but the program will not run with syntax errors, which can make it more difficult to write the code
• Code needs to be recompiled when the code is changed
• Designed for a specific type of processor

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

• Translates source code from high-level languages into machine code, ready to be processed by the CPU
• The program is translated line by line as the program is running

A

Interpreter description

17
Q

Advantages of an interpreter translator

A

• Easy to write source code, as the program will always run, stopping when it finds a syntax error
• Code does not need to be recompiled when code is changed
• It is easy to try out commands when the program has paused after finding an error - this makes interpreted languages very easy for beginner programmers to learn to write code

18
Q

Disadvantages of an interpreter translator

A

• Translation software is required at run-time
• Speed of execution is slower
• Code is not optimised
• Source code is required