Exam-style question
Try this first
Explain why a program containing processor instructions cannot automatically be assumed to work on every processor. In your answer, refer to instruction sets and the parts of an instruction.
Model answer
What a good answer should say
- An instruction set is processor specific, so a processor may not recognise or interpret every instruction supported by another processor.
- Instructions contain an opcode and one or more operands.
- The opcode identifies the basic machine operation and, in the simple model, the addressing mode; the operand supplies a value, memory address or register.
- If the target processor uses a different instruction set or interprets the instruction pattern differently, the instruction may not be understood or may not perform the intended operation.
Explanation
Why this works
The key reason is that processors do not necessarily share the same instruction set. Both the available operations and the interpretation of the opcode and operand depend on the processor model being used.
Common mistake
No common mistake is linked to this question yet.
