Machine Instruction: GATE CS Previous Year Questions

Machine Instruction · Computer Organization and Architecture

36 questions · asked in 19 of 27 years (2000–2026)

MCQ 27 · MSQ 1 · NAT 81-mark 22 · 2-mark 14

2000Questions per year2026

Questions 21–25 of 36

Q21GATE 20082 marksMCQ−0.67 if wrong
Which of the following must be true for the RFE (Return From Exception) instruction on a general purpose processor?

I. It must be a trap instruction
II. It must be a privileged instruction
III. An exception cannot be allowed to occur during execution of an RFE instruction

Q22GATE 20071 markMCQ−0.33 if wrong
Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.
Instruction Operation Instruction size (no.of words) MOV R1, (3000) R1 ← m[3000] 2 LOOP: MOV R2, (R3) R2 ← M[R3] 1 ADD R2, R1 R2 ← R1 + R2 1 MOV (R3), R2 M[R3] ← R2 1 INC R3 R3 ← R3 + 1 1 DEC R1 R1 ← R1 – 1 1 BNZ LOOP Branch on not zero 2 HALT Stop 1
Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are in decimal.

Assume that the memory is byte addressable and the word size is 32 bits. If an interrupt occurs during the execution of the instruction "INC R3", what return address will be pushed on to the stack?

Q23GATE 20071 markMCQ−0.33 if wrong
Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.
Instruction Operation Instruction size (no.of words) MOV R1, (3000) R1 ← m[3000] 2 LOOP: MOV R2, (R3) R2 ← M[R3] 1 ADD R2, R1 R2 ← R1 + R2 1 MOV (R3), R2 M[R3] ← R2 1 INC R3 R3 ← R3 + 1 1 DEC R1 R1 ← R1 – 1 1 BNZ LOOP Branch on not zero 2 HALT Stop 1
Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are in decimal.

Assume that the memory is word addressable. After the execution of this program, the content of memory location 2010 is:

Q24GATE 20071 markMCQ−0.33 if wrong
Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.
Instruction Operation Instruction size (no.of words) MOV R1, (3000) R1 ← m[3000] 2 LOOP: MOV R2, (R3) R2 ← M[R3] 1 ADD R2, R1 R2 ← R1 + R2 1 MOV (R3), R2 M[R3] ← R2 1 INC R3 R3 ← R3 + 1 1 DEC R1 R1 ← R1 – 1 1 BNZ LOOP Branch on not zero 2 HALT Stop 1
Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are in decimal.

Assume that the memory is word addressable. The number of memory references for accessing the data in executing the program completely is:

Q25GATE 20061 markMCQ−0.33 if wrong
The memory locations 1000,1001 and 1020 have data values 18,1 and 16 respectively before the following program is executed.

MOVIRs,1; Move immediateLOADRd,1000(Rs); Load from memoryADDIRd,1000; Add immediateSTOREI0(Rd),20; Store immediate\begin{array}{llll} \text{MOVI} & \text{$R_s, 1$} && \text{; Move immediate} \\ \text{LOAD} & \text{$R_d, 1000(R_s)$} && \text{; Load from memory}\\ \text{ADDI} & \text{$ R_d, 1000$} && \text{; Add immediate}\\ \text{STOREI} & \text{$0(R_d), 20$} && \text{; Store immediate} \end{array}

Which of the statements below is TRUE after the program is executed ?

Keep practising

Topics in Computer Organization and Architecture

All CS topics ›