Gate2017 cs Q38

0. Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC- relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence.
Inst. No.Instruction
i:add R2, R3, R4
i + 1:sub R5, R6, R7
i + 2:cmp R1, R9, R10
i + 3beq R1, offset


Note – Numerical Type question

  • Option : B
  • Explanation :
    I10-3
    24-7
    I38-11
    I412-15
     16-
    I4 is the branch instruction & is the target.
    0 = 16+ relative value
    ∴ relative value = -16
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *