Q.1 Write a program to find the sum of the values 79 H, F5 H andE2 H. put the su
ID: 1830063 • Letter: Q
Question
Q.1Write a program to find the sum of the values 79 H, F5 H andE2 H. put the sum in registers R0(low byte) and R5 (high byte) of 8051.
Note: - Please give answer step bystep.
Write a program to find the sum of the values 79 H, F5 H andE2 H. put the sum in registers R0(low byte) and R5 (high byte) of 8051.
Note: - Please give answer step bystep. Write a program to find the sum of the values 79 H, F5 H andE2 H. put the sum in registers R0(low byte) and R5 (high byte) of 8051.
Note: - Please give answer step bystep.
Explanation / Answer
MOV A,#79H Get thefirst number into A MOV R1,A Loadthe first number inot reg R1 MOV A,#75H Getthe second number into A ADD A,R1 Addthe first two number 79 and 75 MOV R1,A Move the result into reg R1 MOV A,#E2H Getthe third number into A ADDC A,R1 Addthe result of first two numbers whic is in R1 with the thirdnumber MOV R0 ,A Movethe result (lower byte ) into Reg R0 MOV A,#00H Clear theaccumulator ADDC A, #00H Add the carryand 00H, to the content of the A ( That is get the carry fromthe previous addition) MOV R5,A Loadthe lower byte of the addition into reg R5 HLT MOV A,#75H Getthe second number into A ADD A,R1 Addthe first two number 79 and 75 MOV R1,A Move the result into reg R1 MOV A,#E2H Getthe third number into A ADDC A,R1 Addthe result of first two numbers whic is in R1 with the thirdnumber MOV R0 ,A Movethe result (lower byte ) into Reg R0 MOV A,#00H Clear theaccumulator ADDC A, #00H Add the carryand 00H, to the content of the A ( That is get the carry fromthe previous addition) MOV R5,A Loadthe lower byte of the addition into reg R5 HLT MOV A,#E2H Getthe third number into A ADDC A,R1 Addthe result of first two numbers whic is in R1 with the thirdnumber MOV R0 ,A Movethe result (lower byte ) into Reg R0 MOV A,#00H Clear theaccumulator ADDC A, #00H Add the carryand 00H, to the content of the A ( That is get the carry fromthe previous addition) MOV R5,A Loadthe lower byte of the addition into reg R5 HLTRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.