The GATE Grind

GATE 2007 CS – Question 73

Computer Organization and Architecture · I/O Interface: Interrupt and DMA · 2 marks · Multiple choice

R1, R2, R3 are general-purpose registers. Program below is loaded at memory1000; instruction word counts shown. M[3000]=10, R3=2000; each M[2000] through M[2010] initially100. All numbers decimal.

       MOV R1,(3000) ; R1←M[3000]       ;2 words
LOOP:  MOV R2,(R3)   ; R2←M[R3]         ;1 word
       ADD R2,R1    ; R2←R1+R2         ;1 word
       MOV (R3),R2  ; M[R3]←R2         ;1 word
       INC R3       ; R3←R3+1          ;1 word
       DEC R1       ; R1←R1−1          ;1 word
       BNZ LOOP     ; branch ifnotzero ;2 words
       HALT         ; stop             ;1 word

Instead assume byte addressing and32-bit words. An interrupt occurs during INC R3. What return address is pushed onto the stack?

  1. 1005
  2. 1020
  3. 1024
  4. 1040

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) 1024

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More I/O Interface: Interrupt and DMA questions

All I/O Interface: Interrupt and DMA questions →