comp.lang.ada
 help / color / mirror / Atom feed
* Re: [Q] com port function or procedure
  2000-03-21  0:00 [Q] com port function or procedure Hee
@ 2000-03-20  0:00 ` Gisle S�lensminde
  2000-03-20  0:00 ` Gautier
  1 sibling, 0 replies; 3+ messages in thread
From: Gisle S�lensminde @ 2000-03-20  0:00 UTC (permalink / raw)


In article <jB98S2nk$GA.257@news.thrunet.com>, Hee wrote:
>Hi, I'm working in Korea.
>
>C language have com port function such as "outportb" and "inportb".
>Do Ada language have any com port function or procedure?

If you search on www.deja.com for questions on com/parallel/serial ports,
you will see that this question has been asked several times before
in this group. You will also find several answers. 

Well, C does in fact _not_ have these functions. These functions
probably comes with your operating system, and is not a part of C.
If you move code using these functions to a different OS, your C code
will no longer work.

If you want to use these functions from Ada, you must write an 
interface to them. The package standard Ada95 package interfaces.C
and pragma import/export do that.

In addition you must link with the library containing these 
functions. How to do that depent on operating system.

The issue of accessing hardware like this is generally dependent
on the operating system. Maybe someone recognize the function
names and can give you a more precise answer.

P.S: shouldn's this one be in the FAQ? Maybe I should try to submit 
an answer to the FAQ. (or someone else)


-- 
--
Gisle S�lensminde ( gisle@ii.uib.no )   

ln -s /dev/null ~/.netscape/cookies




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Q] com port function or procedure
  2000-03-21  0:00 [Q] com port function or procedure Hee
  2000-03-20  0:00 ` Gisle S�lensminde
@ 2000-03-20  0:00 ` Gautier
  1 sibling, 0 replies; 3+ messages in thread
From: Gautier @ 2000-03-20  0:00 UTC (permalink / raw)


Hee wrote:

> C language have com port function such as "outportb" and "inportb".
> Do Ada language have any com port function or procedure?

You can reach the C function via pragma e.g.

   procedure Outportb(Port : in Unsigned_16; Data : in Unsigned_8);
   pragma Import(C, Outportb, "outportb");

BTW: is it really in every C implementation ? ("C language have...")
______________________________________________________
Gautier  --  http://members.xoom.com/gdemont/gsoft.htm




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Q] com port function or procedure
@ 2000-03-21  0:00 Hee
  2000-03-20  0:00 ` Gisle S�lensminde
  2000-03-20  0:00 ` Gautier
  0 siblings, 2 replies; 3+ messages in thread
From: Hee @ 2000-03-21  0:00 UTC (permalink / raw)


Hi, I'm working in Korea.

C language have com port function such as "outportb" and "inportb".
Do Ada language have any com port function or procedure?






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-03-21  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-21  0:00 [Q] com port function or procedure Hee
2000-03-20  0:00 ` Gisle S�lensminde
2000-03-20  0:00 ` Gautier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox