CPU Instruction Sets (Cambridge (CIE) IGCSE Computer Science): Revision Note
Exam code: 0478 & 0984
CPU Instruction Sets
What is an Instruction set?
- An instruction set is a list of all the commands that can be processed by a CPU 
- Each command has a binary code which is called machine code 
Opcode and operand
- In IGCSE Computer Science, the opcode and operand make up the binary code - The opcode (operation code) is the operation to be performed 
- The operand is the location where the operation is to be performed in 
 
- The table below shows an example instruction set 
- Each instruction has a mnemonic that indicates what the instruction does alongside an example binary code 
- After an instruction is decoded into an opcode and an operand, the CPU finds the opcode in the processor’s instruction set 
- It then knows what operation to perform when executing the instruction 
| Instruction | Mnemonic | Binary code | Command | 
|---|---|---|---|
| Add | ADD | 10100001 | Adds a value to the value currently stored in the accumulator (ACC) | 
| Subtract | SUB | 00100010 | Subtract a value from the values stored in the accumulator | 
| Load | LDA | 10111111 | Load the value stored in a memory location into the accumulator | 
| Store | STA | 01100000 | Store the value in the accumulator in a specific location in memory | 
| Stop | HLT | 00000000 | Stop the program | 
- Instruction lists are machine-specific - A program created using one computer’s instruction set would not run on a computer containing a processor made by a different manufacturer 
- For example, a computer program created using Intel’s instruction set would not run on a device containing an ARM processor 
 
Worked Example
Using the instruction set in the table above what would be the operation if the instruction was 00100010 00000010?
[1]
Answer
Either of:
- The operation would be SUB [1] 
- If the operand was raw data the complete instruction would be to subtract 2 from the value in the accumulator [1] 
Unlock more, it's free!
Did this page help you?

