473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

setvect and getvect in dos.h

hi all,
I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?
if anybody know it, or where I can find this information, please send
e-mail to group or "na*********@hotmail.com"

thanks..
nagehan
Nov 14 '05 #1
5 8697
nagehan wrote:
hi all,
I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?


Try comp.os.ms-dos.programmer

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #2

"nagehan" <na*********@hotmail.com> wrote in message

I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?
if anybody know it, or where I can find this information, please send
e-mail to group or "na*********@hotmail.com"

"far" is a DOS patch on C, and isn't ANSI. The ANSI way to do what you are
trying to achieve is to compile your program with the "large" or "huge"
models and do away with "far" altogether. Unfortunately this will have a
performance impact on your code, ranging from serious to not mattering at
all depending on the application, which is why these compilers include the
use of "far".
Probably the syntax for returning a far pointer from a function will be
someting like

char far *foo(void)
{
char far *answer;
...
return answer;
}

There won't be such a thing as a far pointer to a function (ie a far
function pointer). These will just be regualar ANSI C function pointers.
Nov 14 '05 #3
On 12 Dec 2003 11:01:52 -0800, in comp.lang.c ,
na*********@hotmail.com (nagehan) wrote:
hi all,
I try to write setvect and getvect functions of dos.h,
you mean you're trying to emulate them on some other platform than
DOS? You should ask in a group specialising in that platform.
but I don't
know how can I return a far pointer to a function?


There's no such thing as a "far pointer" in C. this is a dos-ism and
you'd need to ask in a DOS group
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #4
"Malcolm" <ma*****@55bank.freeserve.co.uk> wrote in
news:br**********@news7.svr.pol.co.uk on Fri 12 Dec 2003 01:47:38p:

"nagehan" <na*********@hotmail.com> wrote in message

I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?
if anybody know it, or where I can find this information, please send
e-mail to group or "na*********@hotmail.com"

"far" is a DOS patch on C, and isn't ANSI. The ANSI way to do what you
are trying to achieve is to compile your program with the "large" or
"huge" models and do away with "far" altogether.


Well, maybe on some compilers that would allow ANSI compliant code to
compile correctly. But it isn't an ANSI solution at all, in and of itself.

In Standard C, a pointer is a pointer (assuming they're both pointers to
the same type), and there is no notion of near, far, or memory models. As
far as the Standard is concerned, the compiler is supposed to figure all
of that out without help from you.

Nov 14 '05 #5
August Derleth wrote:
"Malcolm" <ma*****@55bank.freeserve.co.uk> wrote in
news:br**********@news7.svr.pol.co.uk on Fri 12 Dec 2003 01:47:38p:
<snip>
In Standard C, a pointer is a pointer (assuming they're both pointers to
the same type), and there is no notion of near, far, or memory models. As
far as the Standard is concerned, the compiler is supposed to figure all
of that out without help from you.


First sentence is right, second is wrong. The Standard does not specify
how compilers treat source files in non-conforming modes of operation.
Invoking the compiler properly is up to you, and there's no implicit
guarantee that any compiler is going to figure much of anything out
unless you invoke it with the proper options, presumably listed
somewhere in the compiler documentation.

Mark F. Haigh
mf*****@sbcglobal.net

Nov 14 '05 #6

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

Similar topics

18
by: Phui Hock | last post by:
Hi, How do I generate an event and got it handled by a handler? I know how to do it in C++ or Java but I got no idea how to do it in C. What is the best approach to write a function that will take...
13
by: Kris | last post by:
Hi! I have the following instruction: char wyp; scanf("%c",&wyp); this scanf is in a while loop, and I want it to get EXACTLY one character each time. Does anyone knows how to do it? BTW....
4
by: Dmytro Bablinyuk | last post by:
I have an old DOS serial communication program which I want to compile. The program I told was designed under Borland C 3.1 and therefore I am trying to compile it under Borland C 3.1. During...
2
by: gerotica | last post by:
I need to set int28 10 secs after my tsr is loaded. So i´m using int8 (tried with 1c also), counting a few times and then write int28 vector. Here is a piece of the code: int f1 = 1; .......
2
Soujiro
by: Soujiro | last post by:
I wanted to listen for a Ctrl+C in normal mode while my program is running at background.. after a Ctrl+C is detected i wanted to access the clipboard and and get whatever is in there and try to...
4
by: gerotica | last post by:
I saw a lot of info about the problems of trapping int21h, but I really don´t understand what happens. I need to watch some serial operations from another program, wich uses fopen() function as...
0
by: dhruba.bandopadhyay | last post by:
Am using Borland C++ 4.5 for the old dos.h APIs. It appears that newer versions of compilers stop support for the oldskool DOS routines. Am trying to convert/port an oldskool Pascal program that...
7
by: Andrew Wan | last post by:
I found this excellent High Speed Timer (in Pascal). I compiled it (using Turbo Pascal 7 and it runs fine): http://www.sorucevap.com/bilisimteknolojisi/programcilik/pascal/ders.asp?207995 and...
2
by: anon856525 | last post by:
Hi, I'm trying to write a keyboard handle with Borland. I think the code below should work, but it doesn't compile. The problem is I cannot set the return of getvect() to a void interrupt...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.