flat assembler
Message board for the users of flat assembler.

Index > Main > jmp instruction encoding?

Author
Thread Post new topic Reply to topic
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
Looking at a program with a debugger it seems that jmp is a two byte instruction. The first byte being EB and another byte. What is the other byte for? I thought it was the [destaddress] -/+ [currentaddress] but when I do the calculations everything doesn't always add up. Can anyone help me out with this?

_________________
silkodyssey
Post 30 Nov 2003, 20:42
View user's profile Send private message MSN Messenger Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
EB (dest-src-2)

Code:
abc: jmp $ = EB (abc-abc-2) = EBFE    


also there is E9 (long jmp), same as EB but for much farther ranges. Same idea.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 30 Nov 2003, 21:40
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
The address put in the code of jump instruction is just relative to the next instruction - the one following the whole jump, which would be executed if jump was not taken.
Post 30 Nov 2003, 21:45
View user's profile Send private message Visit poster's website Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
Thanks for the info Comrade, Privalov. I guess I had the right idea in the first place. Smile

_________________
silkodyssey
Post 30 Nov 2003, 23:32
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.