edited by
10,109 views
4 votes
4 votes

The contents of the flag register after execution of the following program by $8085$ microprocessor will be

$\textbf{Program}$
$\textsf{SUB A}$
$\textsf{MVI B,(01)}_\textsf{H}$
$\textsf{DCR B}$
$\textsf{HLT}$

  1.  $(54)_\textsf{H}$
  2. $(00)_\textsf{H}$
  3. $(01)_\textsf{H}$
  4. $(45)_\textsf{H}$
edited by

5 Answers

Best answer
10 votes
10 votes

My Answer: None of These, ISRO Answer: (a)

Explanation: 8085 microprocessor has a 8 bit flag register to indicate certain conditions arising after arithmetic and logical operations or to control certain operations.

8085 flag register

  • Carry flag indicates whether there is carry or not after an arithmetic and logical operation.
  • Parity flag indicates whether the result contains odd number of 1s or even number of 1s.
  • Auxiliary carry (or half carry) flag indicates that is there carry from the 3rd bit to 4th.
  • Zero flag indicates whether the result of an arithmetic or logical operation is zero or nonzero.
  • Sign flag indicates whether the result is positive or negative.
  • Other bits in this register are undefined.
Lets traverse the program:
  • SUB A: subtracts the content of accumulator (A) from the content of the accumulator (A); Content of A will become (00)H; Flag Register: 0100 0100 because result is zero and result contains 0 (even) number of 1s.
  • MVI B, (01)H : stores 01 in register B; No computation, no change in Flag Register.
  • DCR B: decreases content of register B; Content of B will become (00)H; Flag Register: 0100 0100 because result is zero and result contains 0 (even) number of 1s and DCR/INC don't affect the carry flag in 8085. 
So, flag register after execution will be 0100 0100 = (44)H.
 
edited by
2 votes
2 votes

According to virtual 8085 processor , answer is 45H
please check

1 votes
1 votes
ans is a.(54)h

can any one explain iam getting doubt..?
1 votes
1 votes

I ran this code in 8085 simulator and step in each step and Got o/p = (45)h as flag value.. Arjun Sir could you explain ...

ISRO 2015 Qtn

Answer:

Related questions

4 votes
4 votes
1 answer
1
go_editor asked Jun 21, 2016
4,611 views
Consider an uncompressed stereo audio signal of CD quality which is sampled at 44.1 kHz and quantized using 16 bits. What is required storage space if a compression ratio...
5 votes
5 votes
3 answers
2
go_editor asked Jun 21, 2016
4,748 views
Which of the following is not an image type used in $\text{MPEG}?$$\text{A}$ frame$\text{B}$ frame$\text{D}$ frame$\text{P}$ frame
5 votes
5 votes
1 answer
3
go_editor asked Jun 20, 2016
3,759 views
Which of the following compression algorithms is used to generate a $\textsf{.png}$ file?$\text{LZ78}$Deflate$\text{LZW}$Huffman
3 votes
3 votes
2 answers
4