Assembly Language Programming: Jumps, Loops, and Control Structures Assessment
Assembly Language Programming: Jumps, Loops, and Control Structures Assessment
2. In conditional jumps, what does the CPU examine to determine if the jump should
occur?
A. The AX register
B. The destination label
C. The FLAG register
D. The instruction pointer
3. Which jump instruction would you use if you want to jump when the result is greater
than zero in signed comparison?
A. JA
B. JG
C. JGE
D. JB
4. For unsigned comparisons, which condition must be true for a JA (Jump if Above)
instruction?
A. ZF = 1 and CF = 1
B. SF = OF
C. ZF = 0 and CF = 0
D. CF = 1
11. Which instruction can prevent unwanted loop execution when CX is zero?
A. JMP
B. JCXZ
C. JZ
D. JNZ
12. How many jumps are typically required in a WHILE loop implementation?
A. One
B. Two
C. Three
D. Four
13. What's the key difference between WHILE and REPEAT loops?
A. REPEAT always executes at least once
B. WHILE always executes at least once
C. REPEAT requires more jumps
D. They are identical in execution
14. When using the JLE instruction, what condition must be true?
A. ZF = 0 and SF = OF
B. ZF = 1 and SF ≠ OF
C. CF = 1
D. OF = 1
17. What's the maximum distance allowed for a conditional jump's destination label?
A. 256 bytes
B. 126 bytes
C. 512 bytes
D. 1024 bytes
18. Which type of jump would you use when comparing unsigned numbers?
A. JG/JNLE
B. JL/JNGE
C. JA/JNBE
D. JO/JNO
19. For implementing an OR condition, what happens if the first condition is false?
A. The program terminates
B. The second condition is checked
C. The loop restarts
D. The flags are cleared
20. What's true about the NEG instruction in the context of IF-THEN structures?
A. It sets the carry flag
B. It changes the sign of the operand
C. It performs logical NOT
D. It clears all flags
ANSWER KEY
1. B
2. C
3. B
4. C
5. D
6. B
7. C
8. C
9. B
10. C
11. B
12. B
13. A
14. B
15. C
16. C
17. B
18. C
19. B
20. B