int add(int value1, int value2){ cout << "arg1: " << value1 << " arg2: " << value2 << endl; return value1 + value2;}
int main(int argc, char* argv[]){ int value3 = add(1, 2); cout << value3 << endl;
X86Compiler c; FileLogger Logger(stdout); c.setLogger(&Logger);
c.newFunc(kX86FuncConvDefault, FuncBuilder1<void, int>());
GpVar result(c.newGpVar()); c.push(Imm(9)); c.push(Imm(10)); c.call((void*)add); //c.mov(dword_ptr(result), eax); c.endFunc(); typedef void (*myfun)(void); myfun fun = asmjit_cast<myfun>(c.make()); fun();
__asm{
mov value3, eax }
cout << value3 << endl;
MemoryManager::getGlobal()->free(fun);
return 0;}--
---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Or just step into the “fun()” call with the disassembly view open; so that you’re stepping into the actual call instruction.
Put it in an X86 emulator.