9. Will the following code jump to the label named Target? mov ax,8109h cmp ax,2
ID: 3873752 • Letter: 9
Question
9. Will the following code jump to the label named Target?
mov ax,8109h
cmp ax,26h
jg Target
10. Will the following code jump to the label named Target?
mov ax,-30
cmp ax,-50
jg Target
11. Will the following code jump to the label named Target?
mov ax,-42
cmp ax,26
ja Target
12. Write instructions that jump to label L1 when the unsigned integer in DX is less than
or equal to the integer in CX.
13. Write instructions that jump to label L2 when the signed integer in AX is greater than
the integer in CX.
14. Write instructions that jump to label L3 when the signed integer in DX is less than or
equal to -151.
CmpE102
Explanation / Answer
9. Will the following code jump to the label named Target?
mov ax,8109h
cmp ax,26h
jg Target
Answer: Code will not jump since 26h is positive and 8109h is negative thus jump is not possible
10. Will the following code jump to the label named Target?
mov ax,-30
cmp ax,-50
jg Target
Answer:
Yes,the following code will jump to the label named Target.
jg-> signed conditional jump
(-30 > -50) so jump is taken.
11. Will the following code jump to the label named Target?
mov ax,-42
cmp ax,26
ja Target
Answer: unsigned representation of 42 and 26 is compared, yes the code will jump to target
12. Write instructions that jump to label L1 when the unsigned integer in DX is less than or equal to the integer in CX.
Answer:
cmp dx,cx
jg L1
13. Write instructions that jump to label L2 when the signed integer in AX is greater than
the integer in CX.
Answer:
cmp ax,cx
jg L2
14. Write instructions that jump to label L3 when the signed integer in DX is less than or
equal to -151.
Answer:
cmp dx,-151
jg L3
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.