0% found this document useful (0 votes)
14 views4 pages

Assembly Language Programming: Jumps, Loops, and Control Structures Assessment

The document is an assessment on Assembly Language Programming focusing on jumps, loops, and control structures. It includes multiple-choice questions that test knowledge on instructions such as JMP, CMP, and conditional jumps, as well as their effects on flags and control flow. An answer key is provided at the end for reference.

Uploaded by

Hol Gh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Assembly Language Programming: Jumps, Loops, and Control Structures Assessment

The document is an assessment on Assembly Language Programming focusing on jumps, loops, and control structures. It includes multiple-choice questions that test knowledge on instructions such as JMP, CMP, and conditional jumps, as well as their effects on flags and control flow. An answer key is provided at the end for reference.

Uploaded by

Hol Gh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assembly Language Programming: Jumps, Loops, and

Control Structures Assessment


1. What is the primary purpose of an unconditional JMP instruction?
A. To execute the next sequential instruction
B. To transfer control to another part of the program
C. To compare two values
D. To terminate the program

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

5. What happens to the flags after executing a jump instruction?


A. All flags are cleared
B. Only the zero flag is affected
C. Only the carry flag is affected
D. Flags remain unchanged

6. What is the purpose of the CMP instruction?


A. It adds two operands
B. It performs an implied subtraction without modifying operands
C. It multiplies two operands
D. It divides two operands
7. If after a CMP instruction, CF=1 and ZF=0, what does this indicate?
A. Destination equals source
B. Destination is greater than source
C. Destination is less than source
D. Invalid comparison

8. Which high-level language structure corresponds to a series of CMP and conditional


jumps?
A. FOR loop
B. WHILE loop
C. CASE statement
D. REPEAT loop

9. In implementing an AND condition in assembly, how many comparisons are typically


needed?
A. One
B. Two
C. Three
D. Four

10. What happens if CX contains 0 before executing a LOOP instruction?


A. The loop is skipped
B. The loop executes once
C. The loop executes 65535 times
D. The program crashes

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

15. In single-flag jumps, what condition triggers a JZ instruction?


A. CF = 1
B. SF = 1
C. ZF = 1
D. OF = 1

16. Which flag combination indicates equality after a CMP instruction?


A. CF = 1, ZF = 0
B. CF = 0, ZF = 0
C. CF = 0, ZF = 1
D. CF = 1, ZF = 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

You might also like