hello,
as the topic title says, i want to generate asm code using AngelScript's Jit capability feature using AsmJit
now, for example, i want to decrement a variable, i should do this:
case asBC_DecVi:
a.dec(ptr(par1, ASMJIT_OFFSET_OF(asSVMRegisters, stackFramePointer)- asBC_SWORDARG0(bc)));
break;
par1 is the asSVMRegisters struct which is passed as the first parameterand, ASMJIT_OFFSET_OF is like offsetof macro, but defined in asmjit
as far as i know, i must retrieve the asSVMRegisters as the first parameter (which i get on the AllocArgs function of the assembler)
now, i have this assembly code which is not correct:
dec [ebx+3]
par1 is on the ebx and ASMJIT_OFFSET_OF() return's 4, if decremented by 1 with asBC_SWORDARG0(), return's 3ok, what am i doing wrong?
this is my JitEntry:
case asBC_JitEntry:
a.mov(dword_ptr(par2), a.getOffset()- firstEntry);
break;
a is the assembler, getOffset return's the position of the asm code and firstEntry is the position of the function when it was started to execute