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

Assembly language Please solve 30 & 36 only Thank you MY DAT 1 DB \"Earth\" MY D

ID: 3785516 • Letter: A

Question

Assembly language

Please solve 30 & 36 only

Thank you

MY DAT 1 DB "Earth" MY DAT 2 DB 987-65 MY DAT 3 DB GABEH 98 30. Compile and state the contents of each ROM location for the following data ORG 340H DAT 1 DB 22, 56 H, 10011001B, 32, 0F6 H, 11111011B SECTION 2.6: 8051 FLAG BITS AND THE PSW REGISTER 31. The PSW is a(n) -bit register. 32. Which bits of PSW are used for the CY and AC flag bits, respectively? 33. Which bits of PSW are used for the ov and P flag bits, respectively? 34. In the ADD instruction, when is CY raised? 35. In the ADD instruction, when is AC raised? 36. What is the value of the CY flag after the following code? CLR. C CY 0 CPL C complement carry 37. Find the CY flag value after each of the following codes (a) MOV A, #54H (b) MOV A, #00 (c) MOV A, #250 ADD A, #0 FFH ADD A, #05 ADD A, #0C4H 8. Write a simple program in which the value 55H is added 5 times. 8051 ASSEMBLY LANGUAGE PROGRAMMING 2:

Explanation / Answer

30. All in hex where contents of each location are:

10011001B = 2^0 + 2^3 + 2^4 + 2^7

= 1 + 8 + 16 + 128 = 153 = (16^1 * 9) + 9 = 99H

32 = 16^1 * 2 + 0 = 20H

11111011 = 2^0 + 2^1 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7

= 1 + 2 + 8 + 16 + 32 + 64 + 128

= 251 = 16*15 + 11 = FBH

Hence, result is

340(22), 341(56), 342(99), 343(20), 344(F6), 345(FB)

36.

The CPL instruction logically complements the value of the specified destination operand and stores the result back in the destination operand. Bits that previously contained a 1 will be changed to a 0 and bits that previously contained a 0 will be changed to a 1. Here, CY = 0, so after CPL instruction CY becomes 1. CY = 1

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