Question: The x86 instruction set includes the REP prefix that causes the instruction to be repeated a given number of times or until a condition is
The x86 instruction set includes the REP prefix that causes the instruction to be repeated a given number of times or until a condition is satisfied. Note that x86 instructions refer to 8 bits as a byte, 16 bits as a word, and 32 bits as a double word. The first three problems in this Exercise refer to the following x86 instruction:![Instruction a. REP MOVSW b. REPNE SCASB Interpretation Repeat until ECX is zero: Mem16[EDI]=Mem16[ESI].](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1698/1/4/1/9656537970d98ec11698141964405.jpg)
Write MIPS code that performs the same operation, assuming that $a0 corresponds to ECX, $a1 to EDI, $a2 to ESI, and $a3 to EAX.
Instruction a. REP MOVSW b. REPNE SCASB Interpretation Repeat until ECX is zero: Mem16[EDI]=Mem16[ESI]. EDI-EDI+2, ESI-ESI+2, ECX-ECX-1 Repeat until ECX is zero: If Mem8[EDI] AL then go to next instruction, otherwise EDI-EDI+1, ECX-ECI+1. Note: AL is the least- significant byte of the EAX register.
Step by Step Solution
3.42 Rating (152 Votes )
There are 3 Steps involved in it
To replicate the functionality of the x86 instruction REP MOVSW in MIPS assembly we need to perform ... View full answer
Get step-by-step solutions from verified subject matter experts
