CPU Flashcards
(4 cards)
1
Q
How mov(srcReg,destReg) works
A
1.Fetch the instruction’s opcode from memory.
2.Update the EIP (extended instruction pointer) register with the address
of the byte following the opcode.
3. Decode the instruction’s opcode to see what instruction it specifies.
4. Fetch the data from the source register (srcReg).
5. Store the fetched value into the destination register (destReg).
2
Q
How mov(srcReg,destMem) works
A
The mov(srcReg,destMem); instruction could use the following execution steps:
- Fetch the instruction’s opcode from memory.
- Update the EIP register with the address of the byte following the opcode.
- Decode the instruction’s opcode to see what instruction it specifies.
- Fetch the displacement associated with the memory operand from the
memory location immediately following the opcode. - Update EIP to point at the first byte beyond the operand that follows the opcode.
If the mov instruction uses a complex addressing mode (for example, the indexed addressing mode), compute the effective address of the destination memory location. - Fetch the data from srcReg.
- Store the fetched value into the destination memory location.
3
Q
The mov(constant,destReg); instruction could use the following execution steps:
A
- Fetch the instruction’s opcode from memory.
- Update the EIP register with the address of the byte following the
opcode. - Decode the instruction’s opcode to see what instruction it specifies.
- Fetch the constant associated with the source operand from the memory
location immediately following the opcode. - Update EIP to point at the first byte beyond the constant that follows the
opcode. - Store the constant value into the destination register.
4
Q
mov(constant,destMem)
A
- Fetch the instruction’s opcode from memory.
- Update the EIP register with the address of the byte following the opcode.
- Decode the instruction’s opcode to see what instruction it specifies.
- Fetch the displacement associated with the memory operand from the
memory location immediately following the opcode. - Update EIP to point at the first byte beyond the operand that follows the
opcode. - Fetch the constant operand’s value from the memory location immediately following the displacement associated with the memory operand.
- Update EIP to point at the first byte beyond the constant.
- If the mov instruction uses a complex addressing mode (for example, the indexed addressing mode), compute the effective address of the destination memory location.
- Store the constant value into the destination memory location.