Executing rrmovl rrmovl rA, rB 2 0 rArB Fetch Memory Read 2 bytes Do nothing Decode Write back m Read operand register rA ■ Update register Execute PC Update Do nothing ■ Increment Pc by2 Processor
– 11 – Processor Executing rrmovl Fetch ◼ Read 2 bytes Decode ◼ Read operand register rA Execute ◼ Do nothing Memory ◼ Do nothing Write back ◼ Update register PC Update ◼ Increment PC by 2 rrmovl rA, rB 2 0 rA rB
Stage Computation: rrmovl P283 Figure 4.16 rrmovI ra. rB icode:ifun←-M1[Pc] Read instruction byte rA:rB←M1[Pc+们 Read register byte Fetch vaIP tPC+2 Compute next PC vaA←R[rA] Read operand A Decode vale(0+ valA Perform ALU operation Execute *vale Memory Write RrB]←vaE Write back result back PC update PC←vaP Update Pc a Formulate instruction execution as sequence of simple steps Use same general form for all instructions Processor
– 12 – Processor Stage Computation: rrmovl P283 Figure 4.16 ◼ Formulate instruction execution as sequence of simple steps ◼ Use same general form for all instructions rrmovl rA, rB icode:ifun M1 [PC] rA:rB M1 [PC+1] valP PC+2 Fetch Read instruction byte Read register byte Compute next PC valA R[rA] Decode Read operand A valE 0 + valA Execute Perform ALU operation *valE Memory Write R[rB] valE back Write back result PC update PC valP Update PC
Executing irmovl irmovlV, rB 308 rB V Fetch Memory Read 6 bytes Do nothing Decode Write back ■ Do nothing ■ Update register Execute PC Update ■ Do nothing ■ ncrement Pc by6 Processor
– 13 – Processor Executing irmovl Fetch ◼ Read 6 bytes Decode ◼ Do nothing Execute ◼ Do nothing Memory ◼ Do nothing Write back ◼ Update register PC Update ◼ Increment PC by 6 irmovl V, rB 3 0 8 rB V
Stage Computation: irmovl P283 Figure4场6 irmov ra. rB icode:ifun←-M1[Pc] Read instruction byte rA:rB←MPc+1] Read register byte Fetch vac←M4PC+2] Read constant value vaIP tPC+6 Compute next PC Decode vaIe<0+ vaIc Perform ALU operation Execute Memor Write RrB]←vaE Write back result back PC update PC←vaP Update Pc a Formulate instruction execution as sequence of simple steps Use same general form for all instructions Processor
– 14 – Processor Stage Computation: irmovl P283 Figure 4.16 ◼ Formulate instruction execution as sequence of simple steps ◼ Use same general form for all instructions irmovl rA, rB icode:ifun M1 [PC] rA:rB M1 [PC+1] valC M4 [PC+2] valP PC+6 Fetch Read instruction byte Read register byte Read constant value Compute next PC Decode valE 0 + valC Execute Perform ALU operation Memory Write R[rB] valE back Write back result PC update PC valP Update PC
gue417P283 Executing rmmovl rmmovl rA, D(rB)4O rB D Fetch Memory Read 6 bytes Write to memory Decode Write back Read operand registers a Do nothing Execute PC Update Compute effective address ■ ncrement Pc by6 Processor
– 15 – Processor Figure 4.17 P283 Executing rmmovl Fetch ◼ Read 6 bytes Decode ◼ Read operand registers Execute ◼ Compute effective address Memory ◼ Write to memory Write back ◼ Do nothing PC Update ◼ Increment PC by 6 rmmovl rA, D(rB) 4 0 rA rB D