Roles and components of the Processor Flashcards
What is Machine Code?
Machine code instructions are written in binary code that the processor can interpret and execute
What are instruction sets?
The instruction set is the set of the machine code instructions that a particular type of processor can understand and execute.
What operations do instruction sets contain?
- Arithmetic operations (ADD, SUB)
- Data transfer operation (MOV, OUT)
- Logical operations (AND, OR)
- Jump operations (JMP, JZ – jump if zero)
How many bits are an Opcode?
- 4 bits
How many bits are an operand?
12 bits
What is an op-code?
Op-code instructions are the part of a machine code instruction that represents a basic machine operation.
What is an operand?
Operand is value or memory address that forms part of a machine code instruction.
How are Instructions and data are located in memory?
Instructions and data are located in memory by using addressing modes
What is immediate addressing?
- Immediate addressing means that the data in the operand is fixed; in other words, it is immediately available for use.
- Typical example: ADD 12 – this instruction could be used to add 12 to the accumulator.
What is an advantage of immediate addressing?
This is a very fast addressing mode since the data is readily available, rather than needing to obtain a data value from a memory address.
What is Direct Addressing?
- Direct addressing, or absolute addressing, means that the code is directly referred to a memory location.
- Example: ADD (1302) – this instruction adds the contents of memory location (1302) to the accumulator.
What is an disadvantage of direct addressing?
The disadvantage of using code that directly refers to memory addresses is that the code cannot be relocated; therefore, it is typically used on single-program systems, such as a car engine fuel control system
What is assembly language?
Assembly language is used to make machine code instructions more understandable by using mnemonic codes
What is ARM?
ARM is a load-store architecture meaning that memory can only be accessed by:
* Loading from memory into a register
* Storing the result back into memory
Explain this example:
LDR r1, #12
ADD r2, r1, #5
SUB r3, r2, #3
STR r3, 1203
Immediate address loads the data without reference to an address
# indicates that the operand is a number
1. Loads the number 12 into the register r1
2. Adds the number 5 to value in r1 and stores result in r2 (making 17)
3. Subtracts the number 3 from value in r2 and stores result in r3 (making 14)
4. Stores the contents of the register r3 (14) into memory address 1203