The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: dsouza123 on March 06, 2007, 12:03:03 AM

Title: computed jmp or conditional call ?
Post by: dsouza123 on March 06, 2007, 12:03:03 AM
The x86 instruction set has conditional jumps; jne, je, jnc, jc etc
and conditional moves; cmovnz, cmovz, cmovnc, cmovc etc.

The close by jumps produced are relative, from what I have seen,
using an offset from the end of the instruction,
is there a way of having computed relative jumps ?

  jmp address+reg

There doesn't appear to be a conditional call instruction
like the conditional jumps and moves, what is the best way to simulate it ?
Title: Re: computed jmp or conditional call ?
Post by: hutch-- on March 06, 2007, 12:20:59 AM
I think you are stuck with having to code the conditional branch yourself and while you probably could push the return address and jump to the location, the CALL /RET(N) mnemonics are probably better optimised in hardware so I doubt you would gain anything from bothering.