From 2170c014b5669487def0cbdff99f8a054db391a1 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Tue, 5 Mar 2024 19:10:20 +0800 Subject: [PATCH] =?UTF-8?q?>=20compile=20NEMU=20ysyx=5F22040000=20?= =?UTF-8?q?=E6=9D=8E=E5=BF=83=E6=9D=A8=20Linux=20calcite=206.6.18=20#1-Nix?= =?UTF-8?q?OS=20SMP=20PREEMPT=5FDYNAMIC=20Fri=20Feb=2023=2008:25:28=20UTC?= =?UTF-8?q?=202024=20x86=5F64=20GNU/Linux=20=2019:10:20=20=20up=20=2022:38?= =?UTF-8?q?,=20=202=20users,=20=20load=20average:=200.28,=200.26,=200.35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nemu/src/isa/riscv32/inst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nemu/src/isa/riscv32/inst.c b/nemu/src/isa/riscv32/inst.c index 68626c4..9224f10 100644 --- a/nemu/src/isa/riscv32/inst.c +++ b/nemu/src/isa/riscv32/inst.c @@ -63,7 +63,7 @@ static int decode_exec(Decode *s) { INSTPAT("??????? ????? ????? ??? ????? 01101 11", lui , U, R(rd) = imm); INSTPAT("??????? ????? ????? ??? ????? 00101 11", auipc , U, R(rd) = s->pc + imm); INSTPAT("??????? ????? ????? ??? ????? 11011 11", jal , J, do {s->dnpc = s->pc + imm; R(rd) = s->pc + 4; } while(0)); - INSTPAT("??????? ????? ????? ??? ????? 11001 11", jalr , I, do {printf("src=%d, pc=%d", src1, s->pc); s->dnpc = s->pc + src1; R(rd) = s->pc + 4; } while(0)); + INSTPAT("??????? ????? ????? ??? ????? 11001 11", jalr , I, do {s->dnpc = src1 + imm; R(rd) = s->pc + 4; } while(0)); INSTPAT("??????? ????? ????? 100 ????? 00000 11", lbu , I, R(rd) = Mr(src1 + imm, 1)); INSTPAT("??????? ????? ????? 000 ????? 01000 11", sb , S, Mw(src1 + imm, 1, src2)); INSTPAT("??????? ????? ????? 010 ????? 01000 11", sw , S, Mw(src1 + imm, 4, src2));