You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
At A-Level you need to understand what an instruction set is, the format of a machine-code instruction, and the different addressing modes used to specify operands. You should also be able to trace through short sequences of assembly-level instructions.
An instruction set (or instruction set architecture — ISA) is the complete collection of all the machine-code instructions that a particular processor can recognise and execute. Each instruction is a binary pattern stored in memory.
The instruction set defines:
A typical machine-code instruction is divided into two parts:
┌──────────────┬──────────────────────┐
│ Opcode │ Operand │
│ (operation) │ (data or address) │
└──────────────┴──────────────────────┘
| Field | Purpose | Example |
|---|---|---|
| Opcode | Specifies the operation to perform | ADD, SUB, LDA (load), STA (store), BRA (branch) |
| Operand | Specifies the data to use, or the address where the data is located | A memory address, a literal value, or a register identifier |
| Category | Examples | Description |
|---|---|---|
| Data transfer | LDA, STA, MOV | Move data between registers and memory |
| Arithmetic | ADD, SUB, MUL, DIV | Perform mathematical calculations |
| Logical | AND, OR, NOT, XOR | Perform bitwise logic operations |
| Comparison | CMP | Compare two values and set status flags |
| Branch / Jump | BRA, BEQ, BNE, BGT, BLT | Change the flow of execution (conditional or unconditional) |
| Shift | LSL, LSR, ASR | Shift bits left or right |
| I/O | IN, OUT | Read from or write to I/O ports |
| Halt | HLT / STOP | Stop execution |
An addressing mode specifies how the operand field of an instruction should be interpreted to find the actual data (the effective address or value). A-Level requires you to know the following modes:
The operand is the data itself — not an address.
LDA #5 ; Load the value 5 into the accumulator
ADD #3 ; Add the literal value 3 to the accumulator
The operand gives the memory address that holds the data.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.