Re:Writing a register based VM in less than 125 lines of C code
by userbinator on Thursday December 09, 2021 @12:14AM
(#29494067)
If 8 registers is "limiting", I don't know what you'd call something like a PIC which has a single accumulator... and yet, C compilers exist for those too. On the bright side, it really reduces the number of choices for register allocation.
You are right about the TOC, my other long articles have them, but for this one I simply forgot to generate one. I will generate it tomorrow.
There's no compiler, and yes you are right managing a limited set of registers is hard when compiling from higher level languages. But there are a few compilers for LC3, so it's not impossible to write them even for such a limiting number of registers. But this is not my area of expertise, so someone more knowledgeable can comment on that.