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

1/ In the following instruction sequence, show the values of the carry, zero, an

ID: 3762223 • Letter: 1

Question

1/ In the following instruction sequence, show the values of the carry, zero, and Sign flags where indicated:

a.mov al, 00110011b

test al, 2;

CF=?, ZF=? SF=?

b.

mov al, 6

cmp al, 5;

CF=?, ZF=? SF=?

c.

mov al, 5

cmp al, 7;

CF=?, ZF=? SF=?

3. In the following instruction sequence, show the changed values of AL where indicated, in binary:

a,mov al. 1100111b and al 00101011b

b. mov al, 4Bh and al,6Ch

c.mov al, 00111100b and oral, 82h;

d. mov al, 94h and xor al,37h

3. In the following instruction sequence, show the changed values of AL where indicated, in hexadecimal

a. mov al, 9Ch not al;

b. mov al,4Bh and al, 74h;

c. mov al 86h oral, 42h;

d. mov al,72h xor al, 0A5h

Explanation / Answer

1

a.

The contents of al is given as follows:

0011 0011b.

After executing the test instruction, the output would be as follows:

0000 0010

Hence, no flag will be set.

Hence, the values of flags, CF, ZF, and SF is 0, 0, and 0 respectively.

b.

The execution of the given statement will set the values of flags as shown below:

CF = 0

ZF = 0

SF = 0

Hence, the values of flags, CF, ZF, and SF is 0, 0, and 0 respectively.

c.

The execution of the given statement will set the values of flags as shown below:

CF = 1

ZF = 0

SF = 1

2.

a.

The AND operation on the values 1100111b and 00101011b will produce the following result:

00001011

Therefore, the changed value of AL in binary would be 00001011.

b.

The AND operation on the values 48h and 82h will produce the following result:

01001000

Therefore, the changed value of AL in binary would be 01001000.

c.

The OR operation on the values 00111100b and 82h will produce the following result:

10111110

Therefore, the changed value of AL in binary would be 10111110.

d.

The XOR operation will produce the following result:

10100011

Therefore, the changed value of AL in binary would be 10100011.

3.

a.

The NOT operation will produce the following result:

63h

So, the hexadecimal value of AL would be 63h.

b.

The AND operation will produce the following result:

040h

So, the hexadecimal value of AL would be 040h.

c.

The OR operation will produce the following result:

C6h

So, the hexadecimal value of AL would be C6h.

d.

The XOR operation will produce the following result:

0D7h

So, the hexadecimal value of AL would be 0D7h.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote