5 votes 5 votes The content of the accumulator after the execution of the following 8085 assembly language program, is: MVI A, 42H MVI B, 05h UGC: ADD B DCR B JNZ UGC ADI 25H HLT 82 H 78 H 76 H 47 H Others ugcnetcse-june2016-paper2 system-software&-compilers + – go_editor asked Aug 16, 2016 recategorized Nov 4, 2017 by Devshree Dubey go_editor 8.1k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Prateek kumar commented Jan 11, 2020 reply Follow Share Step-1: MVI A, 42H given 42 value in hexadecimal and storing value in Accumulator A. For solving problem, convert (42) 16 into decimal is (66) 10 Step-2: MVI B, 05H given 05 value in hexadecimal and storing value in Accumulator B. For solving problem, convert (05) 16 into decimal is (05) 10 Step-3: ADD B until UGC will fail. Contents of accumulator A value and B value will add. 66+5=71 Step-4: DCR B it means decrement by 1. 71+4=75 Step-5: JNZ means jump not equals to zero. 75+3=78 78+2=80 80+1=81 Step-6: It became false, then execute next statement. ADI 25H means add 25H to (81) 10 (25) 16 = (37) 10 37+81=(118) 10 Finally convert decimal value into Hexadecimal. (118) 10 = (76) 16 Step-7: HLT means halt the program. Note: We are converting hexadecimal into decimal for only calculation. without conversion also we can solve a problem. 0 votes 0 votes Deepak Poonia commented Dec 9, 2022 reply Follow Share The instructions in the $8085$ microprocessor. 1. $ADD \,\,\,B$: - The content of operand register $B$ is added to the content of the accumulator and the result is stored in the accumulator. 2. $ADI$: - Add Immediate means add an immediate value to the content of accumulator and the result is stored in accumulator. In the given program, “$A$” is the accumulator, and “$B$” is a register. Accumulator $A$ starts with value $42H = 66(Decimal)$. In every iteration, we add $B$ to $A$, decrement $B$, and if $B$ is not zero, we repeat. So, Final content of accumulator $A$ = 66(initial) + 5($B$ in 1st iteration) + 4($B$ in 2nd iteration) + 3($B$ in 3rd iteration) + 2($B$ in 4th iteration) + 1($B$ in 5th iteration) + 37(due to ADI 25H) = 118(Decimal) So, final $A = 118(Decimal) = 76H$ 0 votes 0 votes Please log in or register to add a comment.
Best answer 0 votes 0 votes A is taking accumulator... A= 4 * 16 + 2 = 66 in decimal B= 5 in decimal Loop runs from B=5 to 1 So 66 + 5 +4 +3+2+1 That is 81 + 25H = 81 + 37 =118 In binary .. 01110110 = 76H papesh answered Aug 16, 2016 selected Sep 24, 2016 by papesh papesh comment Share Follow See 1 comment See all 1 1 comment reply Swati Tandel commented Oct 17, 2016 reply Follow Share y did u converted in hexa 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes A=42 B=05... LOOP B= 5................A=A+B=42+05=47 B=4................47+4=4B B=3................4B+3=4E B=2................4E+2=50 B=1.................50+1=51 --------------------------LOOP ENDS ADI 25H A=51+25= 76H......(3) Swati Tandel answered Oct 17, 2016 Swati Tandel comment Share Follow See all 0 reply Please log in or register to add a comment.