comp.lang.ada
 help / color / mirror / Atom feed
* Re: An Interface question
  1996-07-16  0:00 An Interface question Olivier Cremel
@ 1996-07-16  0:00 ` Robert Dewar
  1996-07-17  0:00 ` Nasser Abbasi
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1996-07-16  0:00 UTC (permalink / raw)



"I'm using an m68k OS (AmigaOS) where system calls expect arguments in
registers, not on the stack as normal convention has it.

I've been reading all Ada95 documents I have but I haven't found a way
to express that convention either for me to access a system call  or
to provide one."


What should be done is that your Ada95 compiler should have a convention
called perhaps System_Call that provides arguments in registers as
required. Then you write

   pragma Import (System_Call, name-of-system-routine);

Obviously there is nothing in the Ada95 documents about this, since it is
highly implementation specific, but a convention such as the one above
is the proper way of handling things.





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

* An Interface question
@ 1996-07-16  0:00 Olivier Cremel
  1996-07-16  0:00 ` Robert Dewar
  1996-07-17  0:00 ` Nasser Abbasi
  0 siblings, 2 replies; 3+ messages in thread
From: Olivier Cremel @ 1996-07-16  0:00 UTC (permalink / raw)



I'm using an m68k OS (AmigaOS) where system calls expect arguments in
registers, not on the stack as normal convention has it.

I've been reading all Ada95 documents I have but I haven't found a way
to express that convention either for me to access a system call  or
to provide one.

Short of writing assembly wrappers, is there a way ?

Thanks,
Olivier.




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

* Re: An Interface question
  1996-07-16  0:00 An Interface question Olivier Cremel
  1996-07-16  0:00 ` Robert Dewar
@ 1996-07-17  0:00 ` Nasser Abbasi
  1 sibling, 0 replies; 3+ messages in thread
From: Nasser Abbasi @ 1996-07-17  0:00 UTC (permalink / raw)
  To: Olivier Cremel



   In article <4sgmgc$n66@idiom.com> ocremel@idiom.com (Olivier Cremel) writes:

   I'm using an m68k OS (AmigaOS) where system calls expect arguments in
   registers, not on the stack as normal convention has it.

   I've been reading all Ada95 documents I have but I haven't found a way
   to express that convention either for me to access a system call  or
   to provide one.

   Short of writing assembly wrappers, is there a way ?

   Thanks,
   Olivier.


You dont have to use Assembly, you can use the language BLISS :)  BLISS 
allows register linkage in calls. 

actually you bring a good question, This same issue happened in VMS, one
was not able to interface to many of VMS original internal code (was was
written in MACRO 32 assembler) by using say C or other high level languages 
becuase many of those VMS entry points expected to pull the arguments 
from specific registers, not from the stack, or may be even a combination 
of the two cases. This is why BLISS was used allot in VMS internal code, 
since BLISS was designed to allow the caller to specify register and/or 
stack linkage.  I remember there was a project in DEC to allow C to also 
do that (i.e add register linkage to C)  so that one can use C in VMS
system programming, I wonder what ever happened to that ?
.. opps.. soory I am getting off the subject..

Nasser

-- 
Nasser Abbasi. C/C++/Ada Solaris. GeneAssist - A client/server application 
for Nucleic acid and protein sequence search and analysis. 
Perkin Elmer - Applied BioSystem division. email:  nasser@apldbio.com   
MSEE(control), MSCS, MSCE, FM (Fide Chess Master).







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

end of thread, other threads:[~1996-07-17  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-16  0:00 An Interface question Olivier Cremel
1996-07-16  0:00 ` Robert Dewar
1996-07-17  0:00 ` Nasser Abbasi

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