Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C pointer related question

Status
Not open for further replies.

raj_rohit10

Advanced Member level 4
Joined
Jul 14, 2004
Messages
100
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Activity points
891
hi,
Please help me to understand difference between far and near pointer.
tq for the reply
 

Near and far pointers are not part of the C language. They are unpleasant extensions provided by some compilers. In some DOS C compilers, near pointers are 16-bit offsets into the current data segment, and far pointers are normalized 32-bit pointers to the entire memory address space.

This is messy business. Search Google for more info and tutorials. If possible, switch to a compiler that doesn't inflict such unpleasantness.
 

yuh i think C does not have near/far pointer..

near/far may refer to same segment/different segment of memory..
 

i you work in a pic compiler you have to say where in which memory the pointer will work

like segment or bank1,bank2 etc.......
 

it depends on the compiler
 

Hi, Rhoit

See if you do not understand what is far and near pointer then i think it is time to worry about them

What i mean is that when you understand pointer enough you would know what are far and near also most compiler do not suport them

also it has nothng to do with logic of execution of the program it is only the speed of program that gets effected so do not bother abt them

if you want to know some thing more specific abt far and near pointer then mention a test case (on what you are working ) I will try to explain
 

hi devennan,
It doesn't come across my work actuall some one ask me regarding that so i just wanted to know about that.If u can please just give me a short exampls so that i can understand it.
tnx
 

near/far pointer seems to be pointer to just different range of them.
 

In assembly, the data memory is divided into data segments. Each byte of data is given an address, which comprises the segment address and the segment offset. A near pointer only stores the segment offset. A far pointer stores both the segment address and the segment offset. Assessing data using near pointers are therefore more efficient provided they fall within the same data segment, but can become clumsy when you often have to access data across different segments. Unless you are doing very low-level programming, you don't have to worry much about it.
 
in C there is no far and near poninter declarations.They are used for other platforms.Just use pointer * declaration.
 

The near and far point is based on the compiler.Try to find the document of the compiler,maybe it is sematically correct but is not working.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top