AntonLydike / riscemu

RISC-V emulator in python
MIT License
48 stars 13 forks source link

Move to explicit handling of immediate values #40

Closed AntonLydike closed 1 year ago

AntonLydike commented 1 year ago

This PR is an implementation of #34, using the following approach:

Change the Instruction.get_imm() to return an Immediate that contains both an absolute value, and a pc relative value.

This forces the instruction implementation to explicitly differentiate between interpreting values as either the numerical value, or as a pc-relative address.

AntonLydike commented 1 year ago

Fixes #29