lua-users home
lua-l archive

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


> The bytecodes produced by luac are endian dependent (as well as

> dependent on word-width and floating point format).

>

> An Intel PC is little-endian, a 68K is big-endian.  You can either

> swab offline, using Kein-Hong Man's ChunkSpy http://luaforge.net/

> projects/chunkspy/ , or rewrite lundump.c to use the other (or

> either) endianness.  I think LHF posted a modified lundump.c to the

> list last year.

>

> This useful fact about luac's bytecodes is documented in its manual:

> http://www.lua.org/manual/5.1/luac.html

>

> I hope that helps.  Good look with re-alloc.

>

> Cheers,

>   drj

 

The problem I was experiencing was 100% due to a bug in our realloc function. Now that that is cleared up, I am able to compile scripts under Visual Studio 6 on an Intel PC (low-endian) and run them unmodified on the prototype hardware using a 68331 (high-endian). There have been no apparent endianness issues (so far). Perhaps the 5.0.2 lundump is already using that LHF code?

 

By increasing the stack space, I was able to get the parser working as well. I have now split out the parsing code thanks to a tech note on lua.org (although it was for version 4.0) and made the code into libraries that allow me to build either barebones (no parser; compiled scripts only), scripting (with parser), and full-blown (with interpreter).

 

Thanks

Tom