Question

In: Computer Science

Comment and show the result and how the flag register (CF, PF, SF, ZF) is affected...

  1. Comment and show the result and how the flag register (CF, PF, SF, ZF) is affected after following

    MOV AX, 39H MOV BL, 09H AND AL, BL

  2. Comment and show the result and how the flag register (CF, PF, SF, ZF) is affected after following

    MOV AX, 0708H MOV BX, 9A68HOR AX, BX

  3. Comment and show the result and how the flag register (CF, PF, SF, ZF) is affected after following

    MOV AX, 9A68H NOT AX

Solutions

Expert Solution

MOV and NOT instruction will not affect the carry, parity, zero and sign flag.

Parity flag is set when low order 8 bits have even 1's

Zero flag is set when all the bits of result is 0

Carry flag is set when an operation result will carry out

Sign flag is set when high order bit(MSB) of result is 1

1.

MOV AX, 39H -> It will store 39 in AX register, set AX = 39H means 0039 so AH = 00H and AL = 39H

MOV BL, 09H -> It will store 09 in BL register, set BL = 09H

Now, AND AL, BL -> It will perform and operation with 39 and 09

in binary 39 0011 1001

in binary 09 0000 1001

And operation between this two numbers = 0011 1001 & 0000 1001 = 0000 1001 = 09H

Here, no carry is set so CF = 0,As MSB is 0, SF will be 0, As value of accumulator is not 0 so, ZF = 0, parity flag will be 0

CF = 0, SF = 0, ZF = 0, PF = 0

2.

MOV AX, 0708H -> sets AX = 0708H

MOV BX, 9A68H -> sets BX = 9A68H

OR AX, BX

In binary 0708 -> 0000 0111 0000 1000

In binary 9A68 -> 1001 1010 0110 1000

Apply OR on this both,

0708 | 9A68 = 0000 0111 0000 1000 || 1001 1010 0110 1000 = 1001 1111 0110 1000 = 9F68H

Here, no carry is set so CF = 0, As MSB is 1, SF will be 1, As value of accumulator is not 0 so, ZF = 0, PF = 0

CF = 0, SF = 1, ZF = 0, PF = 0

3.

NOT instruction won't affect any flags

MOV AX, 9A68H --> sets AX = 9A68H

NOT AX

As AX = 9A68H. In binary, 9A68 = 1001 1010 0110 1000

So NOT AX = 0110 0101 1001 0111

Here, no carry is set so CF = 0, SF = 0, As value of accumulator is not 0 so, ZF = 0, PF = 0

CF = 0, SF = 0, ZF = 0, PF = 0


Related Solutions

A) How would your final result for the % KHP in the unknown be affected (if...
A) How would your final result for the % KHP in the unknown be affected (if at all) if the water used to prepare your unknown solution and your standard KHP solution was CO2-free, but the water used to prepare your NaOH solution was CO2-contaminated? Assume no other experimental error occurred. B) How would your final result for the % KHP in the unknown be affected (if at all) if the water used to prepare your NaOH solution and your...
show the steps how to get the result of this integral with infinite and -infinite as...
show the steps how to get the result of this integral with infinite and -infinite as boundaries ((x^2*(e^x)/((e^x+1)^2) = pi^2 / 3
Show how the United States’ balance of payments accounts are affected when a Bolivian citizen borrows...
Show how the United States’ balance of payments accounts are affected when a Bolivian citizen borrows two million from U.S. banks to buy American farming equipment.
Show how asymmetric information may result in market outcomes which are not Pareto efficient. How might...
Show how asymmetric information may result in market outcomes which are not Pareto efficient. How might the issues caused by asymmetric information be reduced?
Multiply the following base 10 numbers together and then show how the same result can be...
Multiply the following base 10 numbers together and then show how the same result can be obtained via the DFT (fft). Explain your method. 823415 multiplied by 234671
1- Which of the following scheduling algorithms could result in starvation? Why? If any, show how...
1- Which of the following scheduling algorithms could result in starvation? Why? If any, show how can starvation problem be resolved.a. First-come, first-served (FCFS)b. Shortest job first (SJF)c. Round robin (RR)d. Priority?2- Illustrate Peterson solution to critical section problem, showing how it satisfy the conditions of mutual exclusion, progress, and bounded waiting!3- What is the meaning of the term busy waiting? What other kinds of waiting are there in an operating system? Can busy waiting be avoided altogether? Explain your...
Enter two valid BCD numbers. Show the result in seven segment display and LED How to...
Enter two valid BCD numbers. Show the result in seven segment display and LED How to do this using the components dip switch, Two BCD adders 74ls83, And gates, OR gates, 74 ls47 decoder, 7 segment display and LED
1. Show (graphically) how MC pricing can result in losses for the monopoly. 2. What conditions...
1. Show (graphically) how MC pricing can result in losses for the monopoly. 2. What conditions are necessary for a firm to price discriminate? 3. Can a firm in a competitive market discriminate among buyers? Can a firm in a monopolistically competitive market? 4. Compare and contrast the characteristics of a competitive market, monopoly, monopolistic competition, and oligopoly.
Suppose an economy experiences an increase in exports. a) Show graphically using AD-AS model how the price level and output are affected in the long-run.
Suppose an economy experiences an increase in exports. a) Show graphically using AD-AS model how the price level and output are affected in the long-run. b) Can the government use monetary policy to offset the effects on price level and output, explain.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT