StreakPeaked· Practice

ExamsGATETechnical

In an 8085 microprocessor, the following program is executed Address location – Instruction 2000H XRA A 2001H MVI B,04H 2003H MVI A, 03H 2005H RAR 2006H DCR B 2007H JNZ 2005 200AH HLT At the end of program, register A contains

  1. 60H
  2. 30H
  3. 06H
  4. 03H

Correct answer: 60H

Solution

Starting with A=03H (00000011) and CY=0 after XRA A, four RAR (rotate-right-through-carry) operations give 03H->01H->80H->C0H->60H. Final A = 60H, not 30H.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →