Thanks for the speedy response Luiz, however I have tripped over at the first easy hurdle on this.
I need to explain my development environment for a moment. The target board OS I am using has a PC based simulator, which allows me to quickly prototype stuff written for the target OS, which is then running invisibly on top of Windows. Its a neat development setup and saves me a ton on time. I had to modify Lua 5.1.4 slightly to make it run on the Target OS, but once I got that working I am using an identical Lua source tree for both my real OS version and my simulated version. The changes to get Lua running on the Target OS were small, for example some alterations to file related functions, time related functions, changes such that printf() gets aliassed to an OS specific version of printf(). My patched Lua works fine for all source code scripts both for the real target board and the PC simulated target.
What I tried today was to take a one line script print("Hello World"), compile it using a standard PC luac. (I firstly ran this on standard PC lua to comfirm the binary I built was OK)
Then I tried to run this same binary on my PC simulated OS. As this is fundamentally still running on a big endian PC I was anticipating it running just fine. However it didnt produce the "Hello Word" print out on the console screen.
The code didnt crash and both loadResult and pcallResult return 0, so no clues what is going wrong with it
loadResult = luaL_loadfile(L, filename); pcallResult = lua_pcall(L, 0, 0, 0);
I am a bit out of my depth on this as I guess I need to delve into the virtual machine to figure out what is going wrong. Do you have any guesses as to where the problem might be or alternatively any debugging tips that might help me out ?