flat assembler
Message board for the users of flat assembler.

Index > Main > far jump / near jump ?!?

Author
Thread Post new topic Reply to topic
rpasquay



Joined: 17 Dec 2007
Posts: 1
rpasquay
Hi,
at first : Happy holidays ! Very Happy

I'm new to FASM and currently trying to learn programming in assembly language.

I have a question :

What's the difference between a "far jump" and a "near jump" except that a "far jump" is a jump in the whole real mode adress space and a "near jump" is a jump limited to the segment it appears in.
Are there some other functions or whatever which the processor does during a "far jump" alternatively a "near jump" ?
Why and where is there a difference ?
It bothers me although its obviously not very important.

Im very sorry if I overlooked the answer for my questions in another thread or in the Programmers Manual.


PS: Kindly excuse my bad englisch (I'm german).

Goodbye,
Rafael.
Post 24 Dec 2007, 22:04
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
Far: goes a long way.
Near: goes not a long way.

But far is only really useful in 16bit and segmented modes.

In Windows, and most other 32bit OSes, you only need near because all the segment registers give you the entire 32bit address space to 'near jmp' within.
Post 24 Dec 2007, 22:53
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
And in 64bit mode, segmentation is completely abandoned. C and segmentation doesn't get together very well (ever tried to mess with far*far*, ptrdiff_t, etc?)
Post 24 Dec 2007, 23:04
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
vid wrote:
And in 64bit mode, segmentation is completely abandoned.
Except for GS right?
Post 24 Dec 2007, 23:07
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Except for GS right?

and FS, yeah Smile

but they work quite differently. You have to load limit and access rights "normal way" (from GDT or LDT descriptor) first, and then load base address shadow register directly via MSR (to be able to assign full 64bit address to it).
Post 24 Dec 2007, 23:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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.