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].


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

1 Expert Approved Answer
Step: 1 Unlock

Lets explore the typical use cases for each of the provided x86 instructions a REP MOVSW Repeat Move ... View full answer

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 Computer Organization Design Questions!