Please enable JavaScript.
Coggle requires JavaScript to display documents.
Translators and Facilities (1st Generation: Machine Code ((Directly…
Translators and Facilities
1st Generation:
Machine Code
For example 0010 could be instruction for one type of CPU to 'add'
Machine Code
has to match the instruction set of the processor int he computer it is run on
The instructions for the processor have two parts:
the
opcode
The
OPCODE
is 4 bits of binary which specifies the operation to be performed e.g. add, save, print, end etc.
the
operand
The
OPERAND
is 8 bits and represents the data to be used or the memory location where the data can be found.
Consider this machine code:
0001
00001101
0001
is the opcode for 'load'
00001101
is the operand - in this case the number 13
0001
00001101
loads the number 13 into memory
Not all opcodes require an operand e.g. END
Directly executed by the computer processor (no translation required)
Very difficult to write, hard to understand and really hard to find errors
The only language understood by the cimputer
Must match the instruction set of the CPU (might need to write a new program for a computer with a different CPU!)
Written in
binary
2nd Generation:
Assembly Code
Device Drivers are loaded by the Operating System when the computer boots up and are used to control the operation of a piece of hardware such as a printer or monitor.
Assembly code used mnemonics instead of opcodes
0001 - opcode that loads data
Use LOAD in assembly language
1000 - opcode that adds
Use ADD in assembly language
0000 - opcode that stores data
Use STO in assembly language
Despite it being difficult it is still used today to program Device Drivers
Makes it slightly easier to write and understand (but still very hard!)
Must be translated (by and assembler) into machine code
Consists of symbols and letters
One assembly instruction translated into 1 machine code instruction (1:1 relationship)
3rd Generation:
High-Level Languages
Compiler
A program that translates a program written in a high level language (source code) into machine code. The machine code is usually stored in an executable file (.exe). Any changes to the source code will require a new .exe to be compiled. Compiling may take a very long time!
Interpreters
Simulate a computer than understand high level languages. They allow source code to be run 'on-the-fly' without being compiled. Much slower than compiled code, but much more portable/flexible.
Easier for programmers to understand and to find errors.
One instruction can be translated into many machine code instructions.
Use English and mathematical symbols.
Still must be translated into machine code - this is performed by a compiler or an interpreter.