Question: Help with a MIPS Assembly question Question MIPS Assembly for REP MOVSB MIPS is a Reduced Instruction Set Computing (RISC) ISA. Complex Instruction Set Computing

Help with a MIPS Assembly question

Question

MIPS Assembly for REP MOVSB MIPS is a Reduced Instruction Set Computing (RISC) ISA. Complex Instruction Set Computing (CISC) ISAssuch as Intels x86often use one instruction to perform the function of many instructions in a RISC ISA. Here you will implement the MIPS equivalent for a single Intel x86 instruction, REP MOVSB, which we will specify here. The REP MOVSB instruction uses three fixed x86 registers: ECX (count), ESI (source), and EDI (destination). The repeat (REP) prefix on the instruction indicates that it will repeat ECX times. Each iteration, it moves one byte from memory at address ESI to memory at address EDI, and 5 /6 then increments both pointers by one. Thus, the instruction copies ECX bytes from address ESI to address EDI.

a) Write the corresponding assembly code in MIPS ISA that accomplishes the same function as this instruction. You can use any general purpose register. Indicate which MIPS registers you have chosen to correspond to the x86 registers used by REP MOVSB. Try to minimize code size as much as possible.

b)What is the size of the MIPS assembly code you wrote in (a), in bytes? How does it compare to REP MOVSB in x86 (note: REP MOVSB occupies 2 bytes)?

c)) Assume the contents of the x86 register file are as follows before the execution of the REP MOVSB:

EAX: 0xccccaaaa

EBP: 0x00002222

ECX: 0xFEE1DEAD

EDX: 0xfeed4444

ESI:0xdecaffff

EDI: 0xdeaddeed

EBP: 0xe0000000

ESP: 0xe0000000

Now, consider the MIPS assembly code you wrote in (a). How many total instructions will be executed by your code to accomplish the same function as the single REP MOVSB in x86 accomplishes for the given register state?

(d) Assume the contents of the x86 register file are as follows before the execution of the REP MOVSB:

EAX: 0xccccaaaa

EBP: 0x00002222 6 /6

ECX: 0x00000000

EDX: 0xfeed4444

ESI:0xdecaffff

EDI: 0xdeaddeed

EBP: 0xe0000000

ESP: 0xe0000000

Now, answer the same question in (c) for the above register values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!