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
Load the number 10, add the number 21 and store the result at memory location 30.
Opcode Operand
0001 00001010
0100 00010101
0000 00011110
State the data that would be found at memory location 30.
000011111
Explain what is meant by an opcode? (2)
An opcode is the portion of amachine language instruction (1) that specifies the operation to be performed by a microprocessor. (1)
Explain what is meant by an operand? (2)
The operand contains either the data that has to used in an operation (1) or a memory address where data can be found or stored. (1)
How is the information contained in opcodes and operands coded?
In binary format.
State the name for the words that programmers use to represent opcodes.
Mnemonics.
Explain how instructions are coded as bit patterns?
- Programming instructions are compiled into binary to turn on the correct parts of the CPU circuitry
Describe CPU?
The CPU is a complex combination of circuits to provide logic.
How do logical operations work?
Each logical operation is given a binary code. Example 1000 Add.