Applications generations Flashcards
What is a translator ?
A translator is a program that converts high-level source code into low-level machine code, which is then ready to be executed by a computer.
The different types of translators?
There are three types of translator that convert different types of code and work in different ways, i.e. compilers, interpreters, and assemblers.
How do compilers work?
converts high level source code into machine code all at once
What are the cons of using compilers?
Cons of compilers:
a. This initial compilation process is longer than using an interpreter or an assembler.
b. If changes need to be made, the whole program must be recompiled.
c. Once code has been compiled to produce machine code, it can only be executed on certain devices - compiled code is specific to a particular processor type and operating system.
What are the pros of using compilers?
Pros of compilers:
a. Compile code can be run in a machine without an actual translator being present in the machine.
How do interpreters work?
Interpreters translate and execute code line-by-line, reporting the immediate error in a line and stopping, useful for testing sections of code and pinpointing errors.
What are the pros of using interpreters?
Pros of interpreters :
a. They initially are faster than compilers as code is instantly executed.
b. Code can be executed on a range of platforms as long as the right interpreter is available, thus making interpreted code more portable.
What are the cons of using interpreters?
Cons of interpreters :
a. But are slower than running compiled code as code must be translated each time it is executed with an interpreter.
b. Interpreted code requires an interpreter in order to run on different devices.
Talk about assembly code and assemblers
Assembly code is considered to be a low-level language that it’s platform specific, as the instructions used are dependent on the instruction set of the processor. Assemblers translate assembly code into machine code.
What does LDA stands for in assembly language?
Load
What does SUB stands for in assembly language?
Subtract
What does ADD stands for in assembly language?
Add
What does HLT stands for in assembly language?
halt
What does STA stands for in assembly language?
Store
What does INP stands for in assembly language?
input