News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Near and Far

Started by RedXVII, September 08, 2006, 01:57:39 AM

Previous topic - Next topic

RedXVII

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

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

RedXVII

Oh. Ermm woops, I misunderstood it again!  :red  Actually, what you say explains alot and makes good sense.

Thanks hutch :bg