Classification of programming languages and translators

?
What is the main difference between high level languages and low level languages?
High level languages have a higher level of abstraction than LLLs and resemble human language.
1 of 18
Why must high level/assembly languages be translated before they can be executed?
Computers can only execute programs if they are written in the machine code language of its processor
2 of 18
How are HLL programs (source code) translated into machine code (object code)?
Compilers or interpreters translate HLL programs into machine code so it can be executed
3 of 18
How do interpreters translate HLL programs?
- They interpret the commands one line at a time.
- If the interpreter comes across an error, the program will stop at that point.
- Does not produce an object code file.
4 of 18
How do compilers translate HLL programs?
- Convert the whole source code program into object code so it can be executed on the target machine
- All errors must be checked before the program can be compiled
- An example of a compiled language is Visual Basic
5 of 18
What are the advantages of interpreters?
- Easier to find errors in the program
- Program can be easily changed as there is no separate source code
6 of 18
What are the disadvantages of interpreters?
- Need to have the interpreter installed on the machine for the program to run
- In order to publish the program, the source code must be shared
- Slower than compiled programs
7 of 18
What are the advantages of compilers?
- Once the object code is created, it can be used without needing the compiler
- Same source code can be used for other types of computer
- Source code can be kept confidential
- Faster than interpreted languages
8 of 18
What are the disadvantages of compilers?
- Errors in the program can be difficult to trace
- Programs cannot be changed without going back to the source code and re-compiling
9 of 18
What is the difference between machine code and assembly language?
- Machine code is the code executed by the processor, and consists of only 0s and 1s (binary)
- Each processor has its own machine code instruction set
- All programs, HLL and assembly, have to be translated into machine code before they can be executed
10 of 18
How is assembly language translated into machine code?
- Using an assembler
- Each assembly language instruction is translated into a single machine code instruction
- Each different type of processor uses a different assembly language and a different assembler
11 of 18
What does a machine code command consist of?
- an opcode and operand
- the opcode specifies the operation to be carried out, eg. to load, store, add etc.
- the operand represents either data, or a memory location, to be used with the opcode
12 of 18
Why was assembly language developed?
- made programming easier because each opcode has a mnemonic associated with it and the operand is given in denary
13 of 18
Characteristics of high-level languages?
(dis/advantages, uses)
- Relatively easier to learn and faster to program in
- Easier to read and understand, debug and maintain
- Portable
- Higher level of abstraction from the software
- Slower
- Better for creating systems with easy to use user interfaces
14 of 18
Characteristics of low-level languages?
(dis/advantages, uses)
- Assembly language is often used in embedded systems
- Not portable - each processor type has its own machine code and assembly language
- Faster as the programs are written specifically for the hardware
- Difficult to learn and understand
15 of 18
What features of assembly language make it suitable for use in embedded systems?
- Gives the programmer complete control over the system components so it can be used to control and manipulate specific hardware components
- Very efficient code can be written for a particular type of processor, so it will occupy less memory and execute
16 of 18
When would it be appropriate to use a compiler?
- For software that will be run frequently or copyright software sold to a third party
17 of 18
When would it be appropriate to use an interpreter?
- For program development and when programs must be able to run on multiple hardware platforms
18 of 18

Other cards in this set

Card 2

Front

Why must high level/assembly languages be translated before they can be executed?

Back

Computers can only execute programs if they are written in the machine code language of its processor

Card 3

Front

How are HLL programs (source code) translated into machine code (object code)?

Back

Preview of the front of card 3

Card 4

Front

How do interpreters translate HLL programs?

Back

Preview of the front of card 4

Card 5

Front

How do compilers translate HLL programs?

Back

Preview of the front of card 5
View more cards

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all Computer systems resources »