luapower / dynasm

DynASM with Lua mode
http://luapower.com/dynasm
103 stars 10 forks source link

Examples not working #7

Open JomerDev opened 7 years ago

JomerDev commented 7 years ago

I've tried the examples in both Windows and Ubuntu x64, they don't work. It crashes with an assertion fail, when I execute the multiply_x86 example on windows, it returns 786291992

It seems like the esp variables aren't filled with the actual variables

capr commented 7 years ago

works for me :) what do you have different? different luajit version? different toolchain? different build options on luajit, etc. I need more details.

JomerDev commented 7 years ago

I'm on Windows 10, use Luajit 2.1.0-beta2, I don't recall the build options for luajit right now

capr commented 7 years ago

Do you use luapower's binaries for luajit and dynasm?

JomerDev commented 7 years ago

I am

Edit: I just recompiled the binary I use with mingw and nothing changed

capr commented 7 years ago

Sorry Nathan, I don't know how to help you since I can't reproduce the bug. If you find a solution, please let me know.

JomerDev commented 7 years ago

I just rebuild luajit without any build options with mingw. I also redownloaded dynasm and recreated the multiply_x86.dasl file and a main.lua file which looks like this:

` require"dynasm" --hook in the "require" loader for .dasl files

local multiply = require"multiply_x86" --translate, load and run "multiply_x86.dasl"

print(multiply(-7, 5))

--assert(multiply(-7, 5) == -35)`

It prints 0

JomerDev commented 7 years ago

Do you know any reason why the arguments under esp+4 and esp+8 might be empty?