I'm sorry for putting JALR here. Actually JALR is I-type.
JALR rd, rs1, imm
Reg[rd] <- PC + 4; PC <- Reg[rs1] + imm;
Write PC + 4 to Reg[rd] (return address)
PC + 4
Sets PC = Reg[rs1] + offset
Don't need to multiply the immediate by 2.
JALR
JAL rd, imm
Reg[rd] <- PC + 4; PC <- PC + imm;
Sets PC = PC + offset
JAL
What should be added to datapath?
Last updated 1 year ago