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.