P2 T2 L9 The Processor Instruction Set Flashcards
Explain the Instruction set
3 points
- Computer processors have different ways of expressing instructions
- An instruction set describes the commands a processor can perform
- Different types of processors have their own instruction sets but they may perform similar or identical operations
State the types of instruction
6 types
An instruction may have the following types of instruction:
- Data transfer such as LOAD, STORE, MOVE
- Arithmetic operations such as ADD, SUBTRACT
- Comparison operations to compare two values
- Logical operations such as AND, OR, NOT
- Branch – conditional and unconditional
- Shift operations – shift bits left or right in a register
What is machine code?
3 points
- The instruction set defines all the instructions and how they are represented
- Instructions are combinations of binary 1s and 0s; the number of bits used depends on the word length of the processor
- This is known as machine code and is the only language the processor can understand
Explain the components of an instruction
3 points
- An instruction typically includes two parts:
- Operation code (opcode) which includes:
– the actual command the processor needs to carry out, eg. ADD, SUB, etc.
–the addressing mode which specifies whether the operand is the actual data, the memory address where the data is held, or a register - Operand(s) – one or more items of data (which can be values, memory addresses or registers) that are to be used in the instruction
The number of bits allocated to the _______ and _______ will vary according to the processor used.
opcode
operand
What is the operation code made up of?
2 parts in order
- Basic machine operation (First part of opcode, usually largest, e.g. 101101)
- Addressing mode (Second part of opcode, usually smallest, e.g. 00)
e.g.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces
Explain operands (2 points)
- The operand contains a reference to the data that is to be used in the instruction
- This data may be either:
- An actual value that can be used as presented
- The address in memory where the data to be used is held
- The register within the CPU where the data is held
e.g.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces
Explain addressing modes
2 points
- The addressing mode (typically 2 bits, e.g. 00) defines how the machine language instruction identifies the operand of each instruction.
- The data referenced in the operand may be either:
- An actual value that can be used as presented
- The address in memory where the data to be used is held
- The register where the data is held
e.g.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces
(type of addressing mode)
Explain Immediate addressing (2 points)
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces
- Immediate addressing is when the addressing mode (in this case it is 00) specifies that the data is a value (12 in this case), not an address.
- So the operand is the actual value to be used in the instruction.
(type of addressing mode)
Explain Direct addressing (4 points)
- Direct addressing is when the addressing mode (e.g. 01) specifies that the data is an address, not a value.
- So the operand is the address of the location in the memory of the data to be used.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 01………………………….| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces
Machine code uses ____ ______ instructions.
Assembly language uses ___________ for instructions, for example LDA, ADD and MOV.
Both of these (machine code & assembly language) are ____ level languages.
Assembly language is much easier for programmers to code, but still much harder than a _____ _______ language such as Python or Delphi.
pure binary
mnemonics
low
high level
The format of instructions is determined by the processor ____________ set. This defines what the __________ code instructions mean and how the processor should execute them.
Instructions are made up of two parts: ____________, (which includes the addressing mode) and ____________.
The address mode determines how data used by the instruction can be found. _____________ addressing means the operand is the actual value to be used in the instruction.
_____________ addressing indicates that operand is the address of the data to be used.
instruction
machine
opcode
operand
immediate
direct