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)
What would be a typical use for this instruction?
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 (168 Votes )
There are 3 Steps involved in it
Lets explore the typical use cases for each of the provided x86 instructions a REP MOVSW Repeat Move ... View full answer
Get step-by-step solutions from verified subject matter experts
