lua-users home
lua-l archive

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


Hi,

Mark Hamburg wrote:
> So, how tenable would it be to write a byte-order swizzler for Lua binaries?
> For that matter, how tenable would it be to write code that could update
> from Lua 5.0 bytecodes to Lua 5.1 bytecodes (using that as an example of a
> minor architectural revision to the virtual machine)?

Although the opcodes look similar, there are subtle differences.
E.g. the bitfields for the operands are arranged differently and
RK operands are encoded differently. Another major difficulty is
that for loops copy the control variable into an extra stack slot
in 5.1 (i.e. you need to do control flow dependent stack slot
relocation). Not so easy.

Bye,
     Mike