473,324 Members | 1,646 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,324 software developers and data experts.

pascal call in C

hi,
I am working on an old program written in c.The program uses a
function like this

"unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .
Is this a PASCAL function CALL from C?Do I need to have Pascal
installed in my system.This has been written in Turbo C 2.0 under
DOS.Any information on this?
Thanks in advance.
Krishna.V.J.

Jul 18 '06 #1
6 6866
"kkrish" <cl****************@gmail.comwrites:
I am working on an old program written in c.The program uses a
function like this

"unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .
Is this a PASCAL function CALL from C?Do I need to have Pascal
installed in my system.This has been written in Turbo C 2.0 under
DOS.Any information on this?
Consult the documentation for your compiler. Both "far" and "pascal"
are non-standard. (I think "pascal" specifies a calling convention
compatible with whatever Pascal compiler it's supposed to work with;
"far" has something to do with pointer representations and memory
models, but I don't know how it applies here.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 18 '06 #2
* kkrish:
hi,
I am working on an old program written in c.The program uses a
function like this

"unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .
Is this a PASCAL function CALL from C?Do I need to have Pascal
installed in my system.This has been written in Turbo C 2.0 under
DOS.Any information on this?
Thanks in advance.
Krishna.V.J.
The above is platform-specific (PC running DOS or 16-bit Windows) and
outdated -- forget it, and implement ReadFile yourself.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 18 '06 #3
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.orgwrote:
>"kkrish" <cl****************@gmail.comwrites:
> "unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .
>non-standard. (I think "pascal" specifies a calling convention
compatible with whatever Pascal compiler it's supposed to work with;
"far" has something to do with pointer representations and memory
models, but I don't know how it applies here.)
My guess would be that the 'far' probably indicated that you
might need a 'far' (bigger than normal) pointer to the
ReadFile function itself.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
Jul 18 '06 #4
The above is platform-specific (PC running DOS or 16-bit Windows)
and
outdated -- forget it, and implement ReadFile yourself.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Yes , it is platform specific.Seems you know something about this,
can you provide some more info ,please
Krishna V.J

Jul 18 '06 #5
* kkrish:
[quoting signature]
Please don't quote signatures -- removed.
>The above is platform-specific (PC running DOS or 16-bit Windows)
and outdated -- forget it, and implement ReadFile yourself.

Yes , it is platform specific.Seems you know something about this,
can you provide some more info ,please
'far' signified a 32-bit pointer as opposed to a 'near' 16-bit pointer;
see the FAQ item "What are ``near'' and ``far'' pointers?" at <url:
http://c-faq.com/osdep/nearfar.html>.

'pascal' signified a Pascal-like calling convention, essentially that
the function was responsible for adjusting the stack pointer on exit.

Anyway, it doesn't matter: just implement the function yourself.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 18 '06 #6
On 17 Jul 2006 22:01:55 -0700, in comp.lang.c , "kkrish"
<cl****************@gmail.comwrote:
>
The above is platform-specific (PC running DOS or 16-bit Windows)
and
>outdated -- forget it, and implement ReadFile yourself.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Yes , it is platform specific.Seems you know something about this,
can you provide some more info ,please
both "far" and "pascal" are nonstandard extensions to C which date
back to the eighties when 16-bit computing was new. A websearch for
"pascal calling convention" will probably reveal all. Further
discussion is offtopic here.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 18 '06 #7

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

Similar topics

4
by: Chris Gordon-Smith | last post by:
I am tying to call a Pascal function from C++, and vice versa. Does anyone know how to do this, or where detailed information on this topic can be found? For the C++ to Pascal call I have...
24
by: Faith Dorell | last post by:
I really don´t like C.You can write better programs in BASIC than in C, if you don´t like this language. I don´t understand how C became so popular, although much better programming languages...
28
by: Skybuck Flying | last post by:
Hi, I think I understand now a bit better what the difference is between a c compiler and a pascal compiler. For example: When compiling source code with a pascal compiler. The pascal...
0
by: Richard Buckshaw | last post by:
Mimick the older C/ pascal dll parameter passing convention? - VB Class Mod? Hello, I have been attempting to write a VB class that would expose its stuff to an older (ok, legacy application)...
17
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge...
15
by: jacob navia | last post by:
Programming languages come and go. Still is amazing that in this survey from http://www.devsource.com/article2/0,1895,2016936,00.asp the C language comes second, right after Java. Java # What...
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: SMALLp | last post by:
Hy! I desperately need help! I need to make application that would accept Pascal code and check if it returns good results. My idea is (from a beginner point of view) to make application in...
54
by: Ruud | last post by:
Hallo allemaal, During the conversion of my program from Pascal to C, I was more or less able to find the C equivalent of most Pascal functions so far. Only four gave me some real trouble. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.