A451: Instructions Flashcards
What are the three parts of an ‘instruction code’?
- Number bit
- Operand
- Op-code
Explain what is meant by ‘machine code’ or ‘machine language’.
Machine code or machine language is a system of instructions and data executed directly by the central processing unit of a computer
State the format in which the instructions are coded.
The instructions are encoded in binary.
What is the name given to the range of instructions that can be executed?
The instruction set.
State whether there is a common set of instructions or if each set is unique for each processor or family of processors.
The instructions are unique for each processor type.
- Each machine code instruction consists of two fields.
- State the names of each of these fields and the information that they contain.
- The two fields are the opcode and the operand.
- The opcode specifies the operation that is to be performed, e.g. add numbers or store data
in a register. - The operand stores the data that is to be used or the register in which it can be found or
has to be stored.
Explain what mnemonics are and why they are used by programmers.
A mnemonic is a word that is used to represent an opcode, as it is difficult for programmers
to remember all of the opcodes in binary format and use them accurately when coding
algorithms.
0000 STO
Store data at memory location indicated by the operand.
0001 LOAD
Load the number located in the operand.
0010 LOAD
Load the number found at the memory location indicated by the operand.
0100 ADD
Add the number located in the operand.
1000 ADD
Add the number found at the memory location indicated by the operand.
Load the number 13.
Opcode Operand
0001 0001101
Load the number found at memory location 6
Opcode Operand
0010 00000110
Add the number 113.
Opcode Operand
0100 01110001