Re:Jonesforth Port to RISC-V
by KMag on Saturday December 26, 2020 @01:58AM
(#25541922)
The original Jonesforth is very cool, and I'm happy it's being ported to RISC-V. However, the in-code documentation[0] clearly has some errors due to blind find-replace:
> On the right hand side I've written the actual RISC-V machine code.
... followed by a bunch of 5-byte x86 instructions (E8 followed by 4-byte addresses), and '"E8" is the x86 machine code to "CALL" a function'.
> On an RISC-V machine it turns out that we can write this interpreter rather easily, in just two assembly instructions which turn into just 3 bytes of machine code.
Uncompressed RISC-V instructions are 4 bytes. Compressed instructions are 2 bytes. Without some completely unanticipated extension that goes against the current design, there will be no way to make a 3-byte instruction sequence for RISC-V. From what I can tell, the actual RISC-V implementation is 4 instructions,
Re:Jonesforth Port to RISC-V
by fwee on Saturday December 26, 2020 @04:26AM
(#25542344)
Thanks for correcting. Compared to the original, the documentation is just replaced with some keywords. It needs more works to do to make it a useful tutorial.
[0]https://github.com/jjyr/jonesforth_riscv/blob/master/jonesfo...