lua-users home
lua-l archive

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


> I have a two bitecodes what was made with two different lua copilers can you
> explain me difference beetwen those two bitecodes? I see swaped few bytes in
> second line. Can you explain me why? What are that bytes? I use luac version
> 5.3.4.

The order of the byte are different because the platforms where you
ran luac are different.

For the format of the header, see
https://www.lua.org/source/5.3/ldump.c.html#DumpHeader

0000-0020:  08 78 56 00-00 00 00 00-00 00 28 77-40 01 00 00  .xV..... ..(w@...
0000-0020:  08 78 56 00-00 00 28 77-40 00 00 00-00 01 00 00  .xV...(w @.......

The 8 bytes " 00 00 00 00 00 28 77 40" are a double (370.5 in Lua
5.3), stored in Intel order.

The 8 bytes "00 28 77 40 00 00 00 00" are the same number stored in a
different order, I'm guessing an ARM here.