lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello List,

I'm updating luac.nl to further the support for Lua 5.4 bytecode and add additional features, and I have not yet implemented descriptions for the instructions mentioned in the subject. I would like to ask about these instructions, mostly to be sure I understand them correctly;

OP_MMBIN - invokes metamethod denoted by the index in C (enum TMS) with R[A] and R[B] as parameters. If there is a metamethod, is the result placed in the result register of the previous arithmetic instruction? The same goes for OP_MMBINI and OP_MMBINK I assume, is that correct?

OP_MMBINI and OP_MMBINK - similar to OP_MMBIN, but on an integer (sB) or constant (K[B]), am I correct about that?

What is the significance of k in OP_MMBINI and OP_MMBINK? Is it to just flip the two parameters to the metamethod? 

In summary, I assume these instructions (judging by the source code) try to invoke a metamethod indicated by C and put the result in the R(A of previous instruction) if the call could happen, where k indicates whether the parameters to the methamethod should be flipped or not.

Thank you,
Bas Groothedde

_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org