The Gateway to Computer Science Excellence
+4 votes
3.3k views

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
  1. 82 H
  2. 78 H
  3. 76 H
  4. 47 H
in Others by Veteran (105k points)
recategorized by | 3.3k views
0
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.

2 Answers

0 votes
Best answer
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
by Boss (25.7k points)
selected by
0
y did u converted in hexa
+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)
by (319 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,385 answers
198,547 comments
105,359 users