The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RedXVII on September 08, 2006, 01:57:39 AM

Title: Near and Far
Post by: RedXVII on September 08, 2006, 01:57:39 AM
Im trying to understand how this near/far thing works and why it exists/how it works. Tell me if i get this wrong;

A near call/jmp jumps to an address within the .exe module myrunningprocess.exe and a far call/jmp jumps to another module like kernel32.dll

Why not make all jumps a far jumps then and bang it to one opcode rather than have several different types of near/far jumps?  :eek

:snooty:
RedXVII
Title: Re: Near and Far
Post by: hutch-- on September 08, 2006, 02:53:16 AM
Red,

The distinction comes from segmented arctitecture on the x86 hardware. If a processor is being used in segmented addressing mode you need a jump with a difference distance range to jump from one segment address range to another. NEAR addressing is jumps and calls within the same segment range.  Now in terms of 32 bit Windows all addressing has a 4 gigabyte range so all jumps and calls are NEAR as they are within the addressing range.
Title: Re: Near and Far
Post by: RedXVII on September 08, 2006, 03:14:08 AM
Oh. Ermm woops, I misunderstood it again!  :red  Actually, what you say explains alot and makes good sense.

Thanks hutch :bg