57.4k views
3 votes
Which of the following string primitives will modify the EDI register?

a) scasb
b) stosb
c) lodsb
d) cmpsb
e) movsb

User Vartlok
by
8.2k points

1 Answer

3 votes

Final answer:

The string primitive that modifies the EDI register is A. scasb. This instruction compares a byte in AL with the byte at the EDI address and updates EDI to the next position.

Step-by-step explanation:

The string primitive that modifies the EDI register is scasb (scan string byte). The instruction scasb is used in assembly language programming to compare a byte in the AL register with a byte at the address pointed to by the EDI register. Upon execution, scasb updates the EDI register to point to the next position in the string, effectively modifying the EDI register. The other instructions, stosb, lodsb, cmpsb, and movsb, affect different registers or have different operations that do not inherently modify the EDI register.

The correct answer is movsb. The movsb instruction is used to move a byte from the memory location specified by the SI (source index) register to the memory location specified by the DI (destination index) register. It also increments or decrements the SI and DI registers, depending on the direction flag (DF) of the processor. The EDI (extended destination index) register is simply an extension of the DI register, so when you use movsb to move a byte, the EDI register will be modified.

User Piyush Ghediya
by
8.0k points