Re: Need a jump opcode generator.



Ok,

I see the problem.

The intel manual a bit very fucking messy:

It says all kinds of things through each other:

It says:

R
M
Operand
Register

Messssssyyyy.

Apperently I thought immediate value like with a call is allowed... but now
that I read the manual more closely... nono I think it's not allowed now...

But then again I did see another jump in the program and it DID jump to
immediate value... but maybe immediate value's only allowed for 8 bit ***.

Which is again totally differently explained....

It's not called:

Jmp Immediate.

Intel calls it:

Jmp Rel.

And then you need to figure it out what the *** Rel is...

Rel IS immediate value !

But it is SPECIAL value.

It's some kind of offset from current location. Called "relative".

So that's the opcode I would need to use... because it's the shortest one
possibly...

Or maybe a combination of register plus jump is possible too.. but then need
to store stuff in eax/the operand.

I like to keep instructions to minimum.

So let's see.... I know locations where the jump is supposed to be..

So I can calculate relative ***.

So correct opcode is:

E9 with relative 32 bit.

Now me needs to figure out how to calculate relative offset *** ;)

Strange explanation is given me thinks.. something with next instruction in
eip or something not sure what's that about... maybe they mean... next bytes
after e9 get loaded into eip ;)

Gotta read carefully ;)

Bye,
Skybuck.


.


Quantcast