Pregunta

I'm coding in assembly for Intel 8086 under TASM in DosBox and the problem I frequently stumble upon is getting the compilation error of "Relative jump out of range by some bytes" where my conditional jumps are.

Now, I know that conditional jumps are short jumps but is there any way to somehow... "stretch" them? :) I know I can place intermediate jumps or try to assemble the code so that the jumps are in reach but as my program grows larger, I think the latter option may prove to be less valid than now.

Can I somehow tell the compiler to make something with it or can I somehow tweak my jumps?

¿Fue útil?

Solución

It's been a long time since I've done any assembly coding, but as I recall, the usual way to "stretch" a conditional jump is to invert the logic of the test and place an absolute jump representing the branch you want to take just after the conditional jump.

Otros consejos

Another way was to put a "table" of jumps within reach, then you relative jumped to to the jump you wanted to jump to. :)

You could get clever with that and change the jump in the table. Course debugging such code was 'erm "fun"..

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top