Unit 1: History of Programming Flashcards
Machine code
A form of digital (binary) information that is processed by and determines the actions performed by a computer’s Central Processing Unit (CPU).
The code is normally stored as a sequence of bytes in memory, and the fundamental functionality of a CPU is to execute this code as a sequence of instructions.
3 Actions resulting from machine code instructions
- Logical and arithmetic manipulation of digital data
- Transfer of data from one memory location to another
- Making the sequence of execution jump to a new memory location
How many registers does a Z80 CPU have?
8 main registers designated
A, B, C, D, E, F, H, L
How much information can a Z80 register store?
8 Binary Bytes
4 Kinds of operations that can be performed by a Z80 CPU
- Load a byte into a register
- Copy bytes from one register to another
- Copy bytes from a register to a memory location or vice versa
- Perform arithmetic operations on register contents.
Low-level programming language
A programming language that provides little or no abstraction from a computer’s instruction set architecture.
Generally this refers to either machine code or assembly language.
Instruction set
A set of instructions that the processor understands.
Machine code
The set of instructions that a CPU understands directly and can act upon.
A program written in machine code would consist only of binary.
Assembly language
Sits between machine code and high-level language in terms of ease of use.
While high-level languages use statements to form instructions, assembly language uses mnemonics - short abbreviations.
Each mnemonic directly corresponds with a machine code instruction.
Give 5 examples of Assembly mnemonics
LDA, STA, ADD, SUB, MOV
LDA Mnemonic
Loads a value from a memory address
STA Mnemonic
Stores a value in a memory address
ADD Mnemonic
Adds the value held in a memory address to the value held in the accumulator
SUB Mnemonic
Subtracts from the accumulator the value held in a memory address
MOV Mnemonic
Moves the contents of one memory address to another.
Von Neumann architecture
A description of the processing architecture that all CPUs use.
John von Neumann invented the processor architecture which stores a program in memory as instructions and executes them sequentially using the ALU, control unit, and registers.
This is known as a stored program concept.
2 Parts to machine code and assembly instructions
- The opcode
- The operand
Opcode
Operation code.
Specifies instructions that can be executed by a CPU / processor in machine code.
E.g. in an instruction like “move the value 3 to the memory address X”, the opcode is move.
Operand
Data that is manipulated by the CPU/processor according to the given opcode.
E.g. in the instruction “ADD 3”, the operand is 3.
Assembler
A program that translates assembly languages into machine code.
Binary
A number system that contains two symbols, 0 and 1.
Also known as base 2.
Compilation
The process of translating source code into object code all in one go.
The program can then be executed as a whole.
Compiler
A program that translates high-level programming languages into machine code.
Denary
The number system that is most commonly used by people.
It contains 10 unique digits 0 to 9. Also known as decimal or base 10.