From: "Pascal LEJEUNE" <pascal.lejeune@matra-transport.fr>
Subject: question about functions (bis)
Date: 2000/01/21
Date: 2000-01-21T07:12:00+00:00 [thread overview]
Message-ID: <8690s0$8tq$1@news.mgn.net> (raw)
Hello everybody,
Thank you for your replies !!!!
What I want to do, is to give my user the possibility of operators
to a type (for example C := A + B, C := A - B, C := A < B ...). This
type is not very complex (a record of 4 bytes).
Then, my operator is a rename of a function, for example :
function "+" (A, B : in T) return T renames ADD;
Finaly, my function ADD use a hardware component which do
the operation with the addresses (it's an asic which needs
to know on which variable the operation is done) :
function ADD (A, B : in T) return T is
tmp : system.address;
begin
<< find the address of the result (that's my problem !!) >> and
put it in a local variable (tmp)
call a procedure which use directly the hardware :
proc (a'address, b'address, tmp);
end ADD;
So, the problem is quite simple : the type T is a "numerical" type
on which it is normal to have operators ... but the hardware need
to have the address of the arguments and the address of the result !!!
I hope i'll find a "nice" solution (ie in Ada or C), but if it is
impossible,
i'll use ASM !
Thank you !!!
Pascal LEJEUNE
next reply other threads:[~2000-01-21 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-21 0:00 Pascal LEJEUNE [this message]
2000-01-21 0:00 ` question about functions (bis) Philip Anderson
2000-01-21 0:00 ` Jeff Creem
2000-01-21 0:00 ` David C. Hoos, Sr.
2000-01-24 0:00 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox