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

(Yes/No): Will the following code jump to the label named Target? mov ax, 8109h

ID: 3682553 • Letter: #

Question

(Yes/No): Will the following code jump to the label named Target? mov ax, 8109h cmp ax, 26h jg Target (Yes/No): Will the following code jump to the label named Target? mov ax, -30 cmp ax, -50 jg Target (True/False): The OFFSET operator always returns a 16-bit value. (True/False): The TYPE operator returns a value of 4 for doubleword operands. (True/False): The LENGTHOF operator returns the number of bytes in an operand. (True/False): The SIZEOF operator returns the Number of bytes in an operand. Use the following the next several question: Write an instruction that increments val_2. Write an instruction that subtracts val_3 from EAX. Write instructions that subtract val_4 from val_2. If val_2 is incremented by 1 using the ADD instruction, what will be the values of the Carry and Sign flags? If val_4 is incremented by 1 using the ADD instruction, what will be the values of the Overflow and Sign flags? (Yes/No): Is it possible to set the Overflow Hag if you add a positive integer to a negative integer? (Yes/No): Will the Overflow flag be set if you add a negative integer to a negative integer and produce a positive result? (Yes/No): Is it possible for both the Sign and Zero flaps to by set at the same time?

Explanation / Answer

27. Yes

28.Yes

29.False.because in real mode it returns 16-bit and in protected mode it returns 32-bit value.

30.True.

31.False

32.True.

33.inc val2

34.sub eax,val3

35.mov eax,val2

sub eax,val3

36. if val2 after incremented by 1 gives value more than size of operator then carry flag effects otherwise won't.

if val2 after incremented by 1 gives negative result then Sign flag set. otherwise signflag not set.

37.if val4 after incremented by 1 gives negative result then Sign flag set. otherwise signflag not set.

if val4 after incremented by 1 gives value -128,-129 etc.Overflow flag will set.

38.No

39.Yes but it produces negative integer.

40.No because zero is not negative.

if zero come into negative integer then zero and sign flags are set at the same time.