From 07f097202dfe62d3e8fb5d7f3722f8c75e6b62ab Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sun, 18 Apr 2021 23:44:18 +0200 Subject: [PATCH] added lui instruction to RV32I --- riscemu/instructions/RV32I.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/riscemu/instructions/RV32I.py b/riscemu/instructions/RV32I.py index 1375285..b68a6dd 100644 --- a/riscemu/instructions/RV32I.py +++ b/riscemu/instructions/RV32I.py @@ -127,7 +127,10 @@ class RV32I(InstructionSet): ) def instruction_lui(self, ins: 'LoadedInstruction'): - INS_NOT_IMPLEMENTED(ins) + ASSERT_LEN(ins.args, 2) + reg = ins.get_reg(0) + imm = ins.get_imm(1) + self.regs.set(reg, imm << 12) def instruction_auipc(self, ins: 'LoadedInstruction'): INS_NOT_IMPLEMENTED(ins)