0

I have a lot of old code in the form:

FARPROC p[1024];

...


__asm {
   jmp p[128];
}

This worked well for 32-bit applications, but upgrading to 64-bit where inline asm is no longer supported.

Is there an equivalent jmp function in C++?

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56
Jason
  • 13,563
  • 15
  • 74
  • 125

2 Answers2

0

While MSVC won't let you compile ASM, you can instead compile the ASM using MASM and then link against it. There is a fairly comprehensive example of how to do the complete setup here.

From what I can tell you're just trying to invoke a function, in which case invoking functions using the actual language might be a better avenue to consider.

Mikhail
  • 7,749
  • 11
  • 62
  • 136
  • 2
    IIRC `call` will push the return address onto the stack while `jmp` does not so I don't think you can simply treat it like a function. – uNiverselEgacy Apr 24 '17 at 04:17
  • @MegaStupidMonkeys You are correct, jumping is not the same thing as a function call (unless that call gets inlined...), but basically the guy is jumping around code, which is the traditional purpose of functions! – Mikhail Apr 24 '17 at 05:03
0

i didn't use it ever but there is goto function still.