From 6424e20409608dcc083f2dadaf381e101649313f Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 25 Apr 2021 00:08:27 +0200 Subject: Work on J instruction, WIP --- pysc-v/InstructionSets/RV32I.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pysc-v/InstructionSets/RV32I.py b/pysc-v/InstructionSets/RV32I.py index 967b24d..dcdee36 100644 --- a/pysc-v/InstructionSets/RV32I.py +++ b/pysc-v/InstructionSets/RV32I.py @@ -50,7 +50,19 @@ class U(Instruction): pass class J(Instruction): - pass + # TODO check if it's correct + opcode = None + + def __init__(self, rd, imm): + self.rd = rd + self.imm = imm + + def compile(self): + return c_uint32( + (self.imm << 12) +\ + (self.rd << 7) +\ + self.opcode + ) class add(R): -- cgit v1.2.3