-- demonstrates use of call near instruction function handler (atom a1, atom a2, atom a3, atom a4) printf(1, "handler: %d %d %d %d\n", {a1, a2, a3, a4}) return 0 end function include asm.e asm_output(1,1) constant code = get_asm( "pusha "& "push dword 1 "& "push dword 2 "& "push dword 3 "& "push dword 4 "& -- "call near dword ptr [handler_addr] "& "call near dword handler_addr "& "add esp, 16 "& --uncomment this for Linux "popa "& "ret") include dll.e constant handler_addr = --allocate(4) --poke4(handler_addr, call_back(routine_id("handler")) resolve_param("handler_addr", handler_addr) call(code) while get_key() = -1 do end while