News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Why does not go to the address?

Started by alex-rudenkiy, July 02, 2017, 08:42:03 AM

Previous topic - Next topic

alex-rudenkiy

Why does an error occur during compilation? :
       "Instruction does not allow NEAR indirect addressing"
The address to which the jump occurs is correct

jj2007

My crystal ball is not working right now, but it might help if you posted at least the line that the assembler doesn't like.

mineiro

hello alex-rudenkiy;
please, can you post an example so we can analise that brother.
Masm send as error/warning report line based.
Near to me means so so 128 bytes I think of instruction, 127?, (you start counting from 0 or 1? ) if that address space grow so far way will happen.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

hutch--


avcaballero

The near jump error sometimes takes place when you try to do a LOOP or a conditional jump for more than a near jump, then you have to change your jump in such a way that the far jump is for unconditional jump "JMP"

jj2007

I am pleased to see that so many crystal balls are still working :t

avcaballero

Quote from: jj2007 on July 02, 2017, 07:05:51 PM
I am pleased to see that so many crystal balls are still working :t
:biggrin: :biggrin:

alex-rudenkiy

Well, I once again tried, like, it turned out, but, as it were, not. Why did the Nops move?

hutch--

My crystal ball is a bit foggy at the moment, try this.

mov eax, address
jmp eax

avcaballero

You like complicate matters, huh? Instead of code, images. Anyway, if you want to jump somewhere, why not put a label there? It's the simplest way

jmp  easy_label
....

easy_label:
nop
nop
nop


alex-rudenkiy

Okay, thanks, I overdid something  :biggrin:

mineiro

.code
start:
call that_addr
that_addr:
pop eax
sub eax, that_addr - start
;...
push start    ;fake call
ret
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

jj2007

Quote from: caballero on July 02, 2017, 08:16:01 PMif you want to jump somewhere, why not put a label there?

That sounds so easy, but if you don't have the source code, it can be quite difficult.