473,803 Members | 3,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

about far & near keywords in c

hai experts can know about the use of far & near keywords in c lang

Feb 22 '07 #1
10 10766
mk*******@gmail .com wrote:
hai experts can know about the use of far & near keywords in c lang
There are no keywords called far and near in C as standardised by ISO.
They're implementation specific extensions.

<OT>
IIRC they're extensions in Turbo C for use under DOS's segmented
memory model, particularly with pointers. The so called 'near'
pointers are 16 bit and contain an offset address alone while the
'far' pointer is 32 bit and contains a full segment:offset address.
For more details, post to a Turbo C or DOS newsgroup.
</OT>

Feb 22 '07 #2
"santosh" wrote:
>mk*******@gmai l.com wrote:
>...know about the use of far & near keywords in c lang

There are no keywords called far and near in C as standardised by ISO.
They're implementation specific extensions.

<OT>
IIRC they're extensions in Turbo C for use under DOS's segmented
memory model, particularly with pointers. The so called 'near'
pointers are 16 bit and contain an offset address alone while the
'far' pointer is 32 bit and contains a full segment:offset address.
For more details, post to a Turbo C or DOS newsgroup.
</OT>
[OT] The FAR/NEAR keywords were actually introduced by Microsoft, not
Borland, and they quickly spread to every C compiler for the
8086/Intel/DOS world.

Roberto Waltman

[ Please reply to the group,
return address is invalid ]
Feb 22 '07 #3
On Thu, 22 Feb 2007 09:16:38 -0500, Roberto Waltman
<us****@rwaltma n.netwrote:
>"santosh" wrote:
>>mk*******@gma il.com wrote:
>>...know about the use of far & near keywords in c lang
There are no keywords called far and near in C as standardised by ISO.
They're implementation specific extensions.
<snip explanation of far/near by santosh>
>
[OT] The FAR/NEAR keywords were actually introduced by Microsoft, not
Borland, and they quickly spread to every C compiler for the
8086/Intel/DOS world.
<OT>
Well, 'far', 'near' and relatives (mainly 'huge' and 'tiny') are still
used by many cross compilers for microcontroller s. Some compilers use
__near or __far to comply with the ISO standard. Some don't.
</OT>

Have a nice day,
Pradeep
--
All opinions are mine and do not represent the views or
policies of my employer.
R Pradeep Chandran rpc AT pobox DOT com
Feb 22 '07 #4

"R Pradeep Chandran" <se*@sig.beloww rote in message >
<OT>
Well, 'far', 'near' and relatives (mainly 'huge' and 'tiny') are still
used by many cross compilers for microcontroller s. Some compilers use
__near or __far to comply with the ISO standard. Some don't.
</OT>
The huge and tiny memory models were a bit different.
To avoid having to mess about with far pointers, you could declare all
pointers to be far or near by default. There were even large and small
memory models as well.

The big advantage was you had to rewrite all the standrad library functions
to take far pointers. So you learnt how things were implemented.

Feb 22 '07 #5
Roberto Waltman wrote:
>
.... snip ...
>
[OT] The FAR/NEAR keywords were actually introduced by Microsoft,
not Borland, and they quickly spread to every C compiler for the
8086/Intel/DOS world.
Not so. As usual, Microsoft does not innovate. Those keywords
appeared with the assembly language for the 8088/8086, back around
1976. The amazing thing is that Microsoft actually used a
pre-existing standard. This may be tied in with the fact that they
bought their C compiler from somebody else (I forget who).

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Feb 23 '07 #6
On Thu, 22 Feb 2007 20:48:17 -0500, CBFalconer <cb********@yah oo.com>
wrote:
>Roberto Waltman wrote:
>>
... snip ...
>>
[OT] The FAR/NEAR keywords were actually introduced by Microsoft,
not Borland, and they quickly spread to every C compiler for the
8086/Intel/DOS world.

Not so. As usual, Microsoft does not innovate. Those keywords
appeared with the assembly language for the 8088/8086, back around
1976. The amazing thing is that Microsoft actually used a
pre-existing standard. This may be tied in with the fact that they
bought their C compiler from somebody else (I forget who).
I think it was Lattice.

http://en.wikipedia.org/wiki/Lattice_C

Regards
--
jay
http://www.microsoft.com/windows/pro...a/default.mspx
Feb 23 '07 #7
jaysome wrote:
>CBFalconer wrote:
>>Roberto Waltman wrote:
>>[OT] The FAR/NEAR keywords were actually introduced by Microsoft,

Not so. As usual, Microsoft does not innovate.
Those keywords
>>appeared with the assembly language for the 8088/8086, back around
1976.
Right, and Intel would have been the culprit here.

My comment was on the introduction of the far and near keywords as a C
language extension.
Based (from memory,) in reading an interview with somebody who was in
a management position for the DOS Microsoft C compilers.
He took pride in bringing far and near to the masses. (Can not recall
the person's name.)
>The amazing thing is that Microsoft actually used a
>>pre-existing standard. This may be tied in with the fact that they
bought their C compiler from somebody else (I forget who).

I think it was Lattice.

http://en.wikipedia.org/wiki/Lattice_C
Correct. The first C compilers sold under the Microsoft brand where
Lattice-C. (Not even repackaged.)

Roberto Waltman

[ Please reply to the group,
return address is invalid ]
Feb 23 '07 #8
On Thu, 22 Feb 2007 20:48:17 -0500, CBFalconer <cb********@yah oo.com>
wrote in comp.lang.c:
Roberto Waltman wrote:
... snip ...

[OT] The FAR/NEAR keywords were actually introduced by Microsoft,
not Borland, and they quickly spread to every C compiler for the
8086/Intel/DOS world.

Not so. As usual, Microsoft does not innovate. Those keywords
appeared with the assembly language for the 8088/8086, back around
1976. The amazing thing is that Microsoft actually used a
pre-existing standard. This may be tied in with the fact that they
bought their C compiler from somebody else (I forget who).
Sigh...

<off-topic trip down memory lane>

Microsoft's C compiler version prior to Version 3 were Lattice C
repackaged. Microsoft C 3.0 and later were their own in-house
compilers.

Neither Lattice nor Microsoft's pre version 3 compilers supported the
"near" or "far" extension keywords. Nor did they support the "tiny"
or "huge" memory models.

In fact, they did not support mixing pointer types or memory models.
Lattice came with four libraries, for the four possible combinations
of 16/32 bit code/data addressing. It was up to the user to link the
one matched the options passed to the compiler.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Feb 24 '07 #9
Jack Klein wrote:
>
.... snip ...
>
<off-topic trip down memory lane>

Microsoft's C compiler version prior to Version 3 were Lattice C
repackaged. Microsoft C 3.0 and later were their own in-house
compilers.

Neither Lattice nor Microsoft's pre version 3 compilers supported
the "near" or "far" extension keywords. Nor did they support the
"tiny" or "huge" memory models.

In fact, they did not support mixing pointer types or memory
models. Lattice came with four libraries, for the four possible
combinations of 16/32 bit code/data addressing. It was up to the
user to link the one matched the options passed to the compiler.
Then how did the compiler know what kind of calling protocol to
generate? Did it have an anticipator function to read the
following link commands?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Feb 24 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2329
by: el_bandido | last post by:
Hello, I've tried the FAQ and some minutes in googl'ing but was not happy with what I got. Basically I'd like to get a _simple_ example on how I could create a web based (portable across all platforms and applications) form for a simple web application using XML technologies. I would like to have something like follows: An XML DB containing that looks roughly like follows:
39
4415
by: Noticedtrends | last post by:
Can inference search-engines narrow-down the number of often irrelevant results, by using specific keywords; for the purpose of discerning emerging social & business trends? For example, if authors of content subconsciously mention the keywords "lately and noticed" within the same brief sentence, the reader may infer "an unintended message" through the process of "inferential scanning;" a method of noting "semantic anomalies" which may...
3
1971
by: Roop | last post by:
Hello all I need to understand the concepts of following terminology in C Language :-- Q1.. what is the near,far pointer mean's ? what is the difference between the these pointer and normal Pointer that we have decleared like that char *ptr; Q2.. what are the different ways of Inter Process Commnication? and
7
3159
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my question about local variable initialization is still not solved. And some of the replies forked into talking about out parameters. And the thread is becoming way too deep. So I open a new thread here. My question in the previous thead has turned...
2
1839
by: dw | last post by:
Hi, everyone. I'm having difficulty understanding the difference of the keywords "friend" and "protected" vs. some of the other ways you can declare variables in ASP.NET ("dim", "public", and "static"). Can someone provide an example of where you'd use these keywords? Sorry for the newbie question. Thanks.
6
1918
by: snt | last post by:
I have a C# asp.net project in which I create meta keywords dynamically. I have a problem with "&" character. When the page is rendered, the "&" character is converted into "&amp;". Is there any way to stop this? I already once posted this question and did not get any useful help. Any help with this issue will be highly appreciated. Thanks in advance,
5
2407
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as three bolded periods '...' in search-result listings. Additionally, most content is outdated; as many users need up-to-date content. Hence, filtering-through search-results becomes quite cumbersome. The newsgroup listings allow detailed...
0
1320
by: balean | last post by:
Hi guys, I need help. I am trying to extract data from XML file. I am using all the fucntions needed to parse the xml data every thing working fine, but what I am looking for is to take the string data in each element and enter it to database. for example I have the following xml file "sitecontent.xml" . -------------------------- <?xml version="1.0" encoding="UTF-8" ?> - <content> <link>http://www.web.com</link> <title>Title...
20
2305
by: Aaron Gray | last post by:
There does not seem too be anyway to test if two jQuery references are the same element. Given :- ... <div id="1"></div .... Then :- alert( $("#1") == $("#1"))
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.