Hacker News new | ask | show | jobs
by zozbot234 2167 days ago
> It's a bit awkward to write directly. For example, to set a 32-bit register with an immediate value requires setting the upper 20 bits followed by the lower 12. Similar with PC jumps, etc.

Yes, IIRC the standard description of the RISC-V ISA includes assembly macro-instructions that can be programmatically expanded into sequences for things like those. Similar to how "mov" is actually implemented as a special case of "add immediate".

1 comments

Oh for sure, that's great for writing, but when disasembling or looking at the asm listing for a C program you don't get that. Which happens a lot while working on a low level machine like this, especially when building it :-)