translators Flashcards

1
Q

What are translators and how do they help?

A

Translators convert programming languages into machine code.

This helps as computers can only understand machine code for a program to be ran

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

Give three programs for conversion.

A

Assemblers

Compilers

Interpreters

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

What is the function of the assembler?

A

a program that converts low-level language programs into executable code

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

Why does the assembly language use mnemonics instead of machine or binary code?

A

Machine code or binary code is harder to us/ remember

each mnemonic written by programmer is replaced by corresponding binary machine code instruction by the assembler.

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

Give examples of mnemonic used.

A

INPUT= INP

OUTPUT= OUT

STORE= STA

LOAD= LDA

ADD= ADD

SUBTRACT= SUB

BRANCH= BRA

STOP= HLT

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

How does addressing give benefits to the coding of a programmer?

A

each location in a comp memory has an address

data is placed inside any of the addresses

and so we need to remember locations of data

using an assembler, a name can be given to a location which makes the program more readable and helps the programmer remember where items of data are stored

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

What is the function of the compiler?

A

translates a complete program of high level language (source code) into machine code

does this in one go without stopping

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

What can each high level instruction generate?

A

many low level ones

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

What two things does a compiler produce?

A

a program that can be run independently from the compiler

a list of errors at the end of the process

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

What are the two advantages of a compiler?

A

compiled program is faster than interpreted program (run speed)

checks all lines of code… interpreter only checks the ones executed

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

What is the function of the interpreter?

A

analyses source code line by line, converts it into machine code to be executed by CPU

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

Describe the interpreter

A

each high level instruction may generate several low level instructions

program can only run if interpreter is present

if error… the code is stopped and the interpreter shows the error

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

What are two advantages of an interpreter?

A

easier program development (errors can be corrected as the program is being interpreted)

individual lines of code can be modified at run time

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