Chapter 9 (Strings and Arrays) – Assessment
True-False
Please indicate whether each statement is True (T) or False (F).
1. The MOVSW instruction copies a word from the location addressed by ESI to the location
addressed by EDI.
2. The Str_compare procedure returns no value in the EAX register. Instead, it sets the Carry and
Zero flags.
3. The LODSD instruction loads a doubleword from the memory location addressed by ESI.
4. The CMPSW instruction uses memory pointed to by EDI as the source operand.
5. The REPNZ CMPSB instruction pair will execute as long as the byte pointed to by ESI is not
equal to the byte pointed to by EDI.
6. When calling Str_compare in the Irvine32 library, you can pass arguments to it in 32–bit registers.
7. The Str_trim procedure has a second parameter that holds the character to be trimmed from the
end of the string.
8. The EDX and ECX registers can be combined in a based-indexed operand.
T
10. Binary search uses a divide and conquer strategy.
11. On the first pass through an array of N items, the inner loop of a bubble sort executes N − 1 times.
12. If an O(n2) sorting algorithm requires 0.2 seconds to sort an array of 1,000 elements, it will
require 200 seconds to sort 10,000 elements.
13. In 64-bit mode, operands that use register indexes must use 64-bit registers. You can use both
base-index operands and base-index-displacement operands.
14. The REPNE prefix repeats an instruction while the Zero flag is set, and ECX is greater than zero.
15. The CLD instruction causes the ESI and EDI registers to be increased in value by the MOVSB
instruction.