Processor fun! Machine instructions!
Ok, so I'm learning about processors. I want to make sure this series of steps for this machine instruction is correct:
Add LOCA,R0 where LOCA is an address in main memory and R0 is a register.
1: Transfer the contents of the program control (PC) to memory address register (MAR).
2: Send a read signal to main memory for the instruction and store it in the memory data register (MDR).
3: Transfer the contents of the MDR to the instruction register (IR).
Ok...so now we have the instruction loaded into IR. Time to execute it.
4: Transfer the address of LOCA to the MAR (is this copied from the IR?).
5: Send a read signal to main memory for data at LOCA and store it in the MDR.
6: Transfer the contents of the MDR to the arithmetic and logic unit (ALU).
Ok, the hard operand is retrieved. Now for the second one.
7: Transfer the contents of R0 to the ALU.
Now the ALU has its operands...do I send it something to tell it that ADD is the operation to be performed? I think I'm missing a step here. In any case, ALU does its thing, not really a step, and then:
8: Transfer the contents of the ALU to R0.
9: Transfer PC+1 (I think?) to MAR.
10: Send a read signal to main memory and store the contents in MDR.
11: Transfer the contents of MDR to the IR.
And that's slightly over one machine instruction since it's also incremented the IR for the next instruction.
Am I missing anything?
|