Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. What string function is best for initializing an area in memory to the same v

ID: 3857192 • Letter: 1

Question

1. What string function is best for initializing an area in memory to the same value?

Be sure to omit the B,W,D, or Q from the opcode.

2. Which opcode is used to compare two strings in memory?

Be sure to omit the transfer size (B,W,D,Q) from the opcode.

3. Which opcode is used to compare a character to a string in memory?

Be sure to omit the transfer size (B,W,D,Q) from the opcode.

Need help answering these 3 questions for my assembly language class. Im not sure which opcodes are correct for these 3 questions on this string function assignment.

Explanation / Answer

1. What string function is best for initializing an area in memory to the same value?

STOS This instruction stores data from register (AL, AX, or EAX) to memory.

2. Which opcode is used to compare two strings in memory?

CMPS This instruction compares two data items in memory. Data could be of a byte size, word or doubleword.

3. Which opcode is used to compare a character to a string in memory?

SCAS This instruction compares the contents of a register (AL, AX or EAX) with the contents of an item in memory.