Develop a short sequence of instructions that clears (0) thetree leftmost bits o
ID: 1831491 • Letter: D
Question
Develop a short sequence of instructions that clears (0) thetree leftmost bits of DH without changing the remaining of DH andstores the result in BH. SUB AL, 35H in the above instruction, how will the CY flag beaffected if (a) AL > 35H and (b) AL < 35H ? Develop a short sequence of instructions that clears (0) thetree leftmost bits of DH without changing the remaining of DH andstores the result in BH. SUB AL, 35H in the above instruction, how will the CY flag beaffected if (a) AL > 35H and (b) AL < 35H ?Explanation / Answer
MOV A,D Loadthe content of reg D into accumulator ANI A,1FH AND1FH with the content of D MOV B,A Storethe result in register B Ex. If D contains 1011 0111 After 1st instruction A will have 1011 111 Only the leftmost bists should be cleared, so these bits areANDed with 0s and the remaing bits are ANDed with 1s s tha theyremain unchanged. There for AND the content of A with 0001 1111 =1F 1011 0111 0001 1111 ANDing ---------------- 0001 0111 See that only the leftmost three bits are cleared (2) SUB AL, 35H This instruction subtracts 35H from the content of theaccumulator, that is [A] = [A] - 35H When AL >35 The result will be positive and hence the CY flag will beRESET When AL < 35H The resut will be negative and hence the CY flag will beSET (Note the carr flag is used as a borrow flag, which will beSET when you subtrat a larger number from a smaller number)Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.