by Rochus · 4y ago · 0 comments
That's wrong. A, B, C are not registers, but sections in an instruction which reference registers. Registers are identified by an 8 bit number, so there are much more than five registers. See e.g. https://the-ravi-programming-language.readthedocs.io/en/late... or https://www.lua.org/doc/jucs05.pdf.
Will make it more obvious that these registers are part of the instruction itself as it may confuse people that are familiar with more traditional VMs.
No, A, B and C are called "instruction field", not "register". The registers are referenced in the text like e.g. "R(A)" meaning "the register signified by instruction field A". E.g. the instruction "MOVE A B" is described as "R(A) := R(B)". Each register carries a Lua value. The registers are not part of the instructions, but part of the activation record, which is allocated when Lua enters a function.