2.5 Translators and Facilities of Languages COMPLETE Flashcards

1
Q

What are assemblers responsible for?

A

Converting low-level assembly language into machine code.

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

How do assemblers have a one to one relationship?

A

Each line of assembly code is converted or looked up by the assembler and translates directly into one line of binary.

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

Why are assemblers processor specific?

A

Each CPU has a unique set of instructions for itself, which won’t work on other CPU’s

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

Define translator

A

Any program which converts source code (code written in a programming language) into the machine code (binary).

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

What are compilers and interpreters responsible for?

A

Converting high-level languages into binary.

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

How do compilers and interpreters have a one to many relationship?

A

Each single line of high level source code written by a programmer translates into many lines of binary.

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

How do interpreters translate a high level language?

A

They take one line of high language program code and convert it directly into binary and then run it

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

Why are interpreters useful when debugging a program?

A

Because they will stop at the first line which contains an error.

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

What is a disadvantage of interpreters debugging a program?

A

The interpreter will require access to the whole source code each time it needs to translate it.

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

How are interpreters debugging a program inefficient?

A

It’s a security issue, the code can be stolen.

The code executes quite slowly, especially for large programs.

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

How do compilers translate a high level language?

A

They take the entire program and converts it into object code which can be quite slow.

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

Why can a compiler be better than an interpreter?

A

The compiled object code will run a lot faster than an interpreted version.

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

Why can an interpreter be better than a compiler?

A

If the program needs to be updated now, the original source code would have to be changed and a new version compiled and distributed.

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

What is an integrated development environment (IDE)?

A

A program which provides resources and tools with high level languages.

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

What are some included tools?

A

Multi-window text editing.

Run Time Environment.

Built-in translator.

Integrated debugger.

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

Why do most professional programmers use more complex IDE’s?

A

Because they provide a whole host of extra features and resources to help them complete their complex programs faster.

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

What is a text editor?

A

A text area used for programmers to enter code directly into the IDE.

It contains:
Syntax highlighting.
Autocomplete code.
Self-indentation support.

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

What are error diagnostics?

A

A feature which reports errors (mainly syntax) in the code and potential problems along with where they’re found and often suggestion on who to fix.

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

What are runtime environments?

A

Software to support the execution and running of programs.

They allow developer to run their code during development in order to check for logical error.

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

What is auto-documentation?

A

A feature which tracks variables declared by the programmer in order to produce self – documentation.

It helps with:
Program maintenance.
Debugging.
Support.

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

What is high-level language?

A

A programming language that uses key words such as PRINT or IF and it has a set of grammar rules (syntax) making it close to English.

E.g. python, java or C++

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

What is assembly language?

A

A low level language written in mnemonics that closely reflects CPU operations used for device drivers.

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

What is a driver?

A

It tells a specific hard drive what to do and is used when fast execution is required or there is limited memory / file size.

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

Why does the high level language need to translated into binary?

A

Because the only thing computers understand is binary as the 1’s and 0’s represent on and off for each instruction.

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

Why might someone compile their code?

A

If they made a new program worth millions and wanted to sell it to people, they could compile the code and then send them it in binary so the people can’t copy your source code.

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

What is a disadvantage of compiling?

A

If there are errors in the source code, you will have to fix it and compile the code again which takes time.

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

Define a program

A

Instructions which tell the computer what to do to find a solution to a problem.

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

Which languages are hardware specific and not portable (needs to be modified to run on another computer?

A

Machine and assembly.

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

Why might high-level languages need to be modified?

A

Because they can’t run on different OS.

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

Instructions for computers are written in programming languages that need to be translated into what before the computer can understand them?

A

Machine code

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

Is machine language a high level or low level language?

A

Low level

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

Is assembly language a high level or low level language?

A

Low level

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

Processors only understand instructions written in…

A

1s and 0s

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

At the processing level, what form are computer programs in?

A

Millions of 1s and 0s known as machine code or machine language

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

Computer programs being in the form of millions of 1s and 0s is known as…

A

machine code / machine language

36
Q

Each instruction in assembly language is directly equivalent to…

A

one in machine code

37
Q

How are mnemonics used to replace the command represented as strings of 1s and 0s with assembly language?

A

e.g. ADD is a mnemonic used to replace the binary command to add numbers together

38
Q

Words called _________ are used to replace the command represented as strings of 1s and 0s in machine code with an assembly language

A

mneumonics

39
Q

What are high-level languages?

A

Programming languages that resemble human languages

40
Q

High-level languages use key words such as…

A

‘print’, ‘if’, ‘then’, etc

41
Q

What do high-level languages do?

A

Address the programming logic rather than dealing with hardware issues such as memory addressing

42
Q

Most programs are written in high/low level languages?

A

high

43
Q

When is assembly language often used?

A

In programs used by embedded systems such as those in cameras, microwaves and televisions

44
Q

Why is assembly language often used in programs used by embedded systems?

A

It can be used to directly control system hardware

45
Q

Give an example of an embedded system

A

Any from cameras, microwaves, televisions, etc

46
Q

High/low level languages are used to write device drivers and real-time systems where speed is essential

A

low

47
Q

What type of programming language is specific to each type of CPU?

A

Assembly

48
Q

With assembly language, programs written for one type of CPU can/cannot be used on others

A

cannot

49
Q

Most software is developed using a high/low-level language

A

high

50
Q

Why is most software developed using a high-level language?

A

It is less time-consuming to write and quicker to test

51
Q

Programs written with low/high level languages are portable from one machine to another

A

high

52
Q

Most low/high level languages can be used with different types of CPU

A

high

53
Q

Programs written in assembly languages and high-level languages must be translated into what before the processor can execute them?

A

machine code

54
Q

Give the 2 examples of translators

A

Compilers and interpreters

55
Q

What does a compiler do?

A

Translates the source code into a standalone, machine code program that can then be executed by the processor

56
Q

With a compiler/interpreter, the translation is done once and as a separate process

A

Compiler

57
Q

With a compiler/interpreter, the program that is run is already translated into machine code so it can be executed more rapidly

A

Compiler

58
Q

With a compiler/interpreter, it protects the software from competitors who would otherwise be able to see the source code

A

Compiler

59
Q

When using a compiler, what happens if any errors are encountered?

A

It carries on trying to compile the program and reports the errors at the end. Programmers then have to use the error messages to identify and remove the bugs

60
Q

What do programmers have to do when there are error messages when executing a programme?

A

Use error messages to identify and remove the bugs

61
Q

With a compiler, you cannot change the program without…

A

going back to the original source code, editing that and recompiling

62
Q

What does an interpreter do?

A

Translate high-level code line by line into machine code. It is needed each time the program is run

63
Q

With a compiler/interpreter, when an error is found, the interpreter reports it and stops and pinpoints the error so that the programmer knows where it has occurred

A

interpreter

64
Q

With a compiler/interpreter, the code is not platform specific and can be run on different operating systems and platforms as long as there is one of these

A

interpreter

65
Q

With a compiler/interpreter, the program can be easily edited as it always exists as source code

A

interpreter

66
Q

With a compiler/interpreter, every line has to be translated every time it is executed and therefore it is slower to run

A

interpreter

67
Q

What do assemblers do?

A

Translate the mnemonics of assembly language into machine code instructions

68
Q

Assembly language is very different from/similar to machine code

A

similar to

69
Q

How many assembly language instructions are there for each machine language instruction?

A

1

70
Q

Explain why program code developed using a high-level language must be translated

A

Instructions must be translated into machine code as that is the only language that the processor can execute

71
Q

What does IDE stand for?

A

Integrated Development Environment

72
Q

An IDE provides…

A

facilities for computer programmers to develop software more efficiently

73
Q

What is a source code editor?

A

A text editor designed for writing and editing source code

74
Q

What does syntax highlighting do?

A

Displays source code in different colours and fonts according to the type

75
Q

What does bracket matching do?

A

Highlights matching sets of delimiters such as brackets and quotation marks to help the programmer navigate through the code and spot any that do not match

76
Q

What does auto indentation do?

A

Automatically indents the next line if it is required

77
Q

What does autocomplete/word completion do?

A

Predicts a word or command that the user is typing and completes it

78
Q

With error diagnostics, facilities are provided to…

A

debug the code

79
Q

What does single-stepping allow in terms of error diagnostics?

A

The code to be run and inspected one line at a time. It shows the result of a single command

80
Q

What do breakpoints allow in terms of error diagnostics?

A

The code to be stopped at selected positions. If there is a problem, then the programmer can set sequential breakpoints to see in which section the error occurs

81
Q

In terms of error diagnostics, what does variable tracing allow?

A

Allows the programmer to inspect the values of variables at any point in the program to check if they are as expected

82
Q

What does run-time environment allow?

A

The code to run within the IDE as though it was actually running on the processor

83
Q

What does run-time environment mean a programmer doesn’t have to do?

A

Waste time preparing the program to run on the real CPU

84
Q

In order for code to run within an IDE, it has to go through what?

A

A translation

85
Q

Give 3 examples of tools available in an IDE

A

Any 3 from source code editor (syntax highlighting, bracket matching, auto indentation and autocomplete), error diagnostics (single-stepping, breakpoints and variable tracing) and run-time environment