The GATE Grind

GATE 2014 EE (EE2) – Question 62

Analog and Digital Electronics · VCOs and timers, combinatorial and sequential logic circuits, multiplexers, demultiplexers · 2 marks · Multiple choice

The following 8085 program executes. Find register A at termination.

2000H  XRA A
2001H  MVI B,04H
2003H  MVI A,03H
2005H  RAR
2006H  DCR B
2007H  JNZ 2005
200AH  HLT
  1. 60H
  2. 30H
  3. 06H
  4. 03H

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) 60H

Explanation

XRAAinitially clearsAand carry;MVIB,04Hsets four iterations,andMVIA,03HloadsA. RARrotates through carry,whileDCRBdoes not change carry. The(A,carry)sequence is(01H,1),(80H,1),(C0H,0),(60H,0). After the fourth decrementB=0andJNZfalls through. Thus **A=60H,A**.