Translators
Machine Code
Interpreter:
Machine code is the language in which CPU’s work in at the lowest value.
It is represented in binary, 1 or 0. Either on/off (relates to transistors in a CPU which direct electricity around).
Machine code is made up of opcode or operand.
Assembly Language
This is a low level language that is related to the computer it is being programmed for. It is specific to the machine it is on (assembly language differs from different manufacturers).
It Uses descriptive names for data stores, mnemonics for instructions and labels to allow selection. Each instruction is usually translated into one corresponding machine code instruction.
Mneumonics
The words that represent the instructions in Assembly language are called mneumonics.
Opcode and Operand
A machine code instruction consists of an opcode that tells the CPU what to do and an operand that is the number to do it with.
Source Code
The source code is the program that has been written by a human in an easy-to-understand programming language such as Python or Swift. This is the program that has to be converted to something the computer can understand.
Object Code
This is the code that is produced by the compiler or assembler after it has 'translated' the Source code.
Compiler and Assembler
These are the things that convert the source code written by a human into the object code that can be understood by the CPU in a computer (therefor letting it carry out the desired function).
There are some differences between a compiler and an assembler:
Compiler:
- Translates the whole program as a unit
- Creates an executable program / intermediate program
- May report a number of errors at the same time
- Code is optimised
Interpreter:
- Translates one line / statement at a time
- Allows each line to be run before the execution of the next line
- Reports one error at a time
- Stops when an error occurs
Comments
Post a Comment