donno/dlx

Some instructions calcuate their immediate value relative to the IC (PC).

Closed this issue · 1 comments

Some instructions which use immediate need to be calculated relative to the instructions position (i.e instruction counter).

For example:
jal bar

If jal instruction is at address 0x0000004C (76), and bar is at 0x00000004, then the immediate value written into the instruction is -72.

As it is relative and not absolute (i.e it is not "jal 4" but "jal -72").

donno commented

Fixed in 5b629df

This has been done on a per-instruction basis and I may have missed some .