comp.lang.ada
 help / color / mirror / Atom feed
* Ada95: at clause - 'Address
@ 1996-10-18  0:00 Ramesh Sadasivam
  1996-10-18  0:00 ` Robert A Duff
  1996-10-19  0:00 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: Ramesh Sadasivam @ 1996-10-18  0:00 UTC (permalink / raw)
  Cc: ramesh


In Ada95 I guess the "at clause" has been replaced with the 'Address.
I'm trying to port a piece of software from Ada83 to Ada95, and the "at
clause" is being handled differently by the GNAT compiler. In case 1 it
ignores it (I'm not sure if it will work, as I do not have the complete
software compiled), and in case 2 it complains. Is there any way to get
around this problem.

CASE 1:
-------
The complier does not complain about the following code.

for TWO_INT_REC_TYPE use
--% Bit-rep for 64-bit computations
  record at mod 8;
    INT1     at 0  range 0..31;
--% Bit-rep for first integer of 64-bit computation
    INT2     at 4  range 0..31;
--% Bit-rep for second integer of 64-bit computation
  end record;

function case_one(X : in SYSTEM.ADDRESS;
		  Y : in SYSTEM.ADDRESS) return BOOLEAN is

X_REC : TWO_INT_REC_TYPE;
for X_REC use at X;
	begin
		....
		....
	end case_one;


CASE 2:
------

procedure case_two(
    ITEM       : in SYSTEM.ADDRESS;
    ITEM_COUNT : POSITIVE := 1 ) is

    ITEM_ADDRESS : SYSTEM.ADDRESS := ITEM; 

  begin
    -- LOOP through each item to be byte swapped
    for COUNT in 1 .. ITEM_COUNT
    loop

      -- Perform the byte swap operation
      SWAP:
      declare
        OLD_VALUE : EIGHT_BYTES_TYPE;
        NEW_VALUE : EIGHT_BYTES_TYPE;
-- tried the the following two ways. Both ways are not accepted by the
compiler, and do not work.

        for NEW_VALUE use at ITEM_ADDRESS;
	for NEW_VALUE'ADDRESS use ITEM_ADDRESS;
     
      begin
	.....
	.....
      end;

Please respond directly to my email address (ramesh@eagle.bgm.link.com),
any help/ideas appreciated.


Thanks,

Ramesh




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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-18  0:00 Ada95: at clause - 'Address Ramesh Sadasivam
1996-10-18  0:00 ` Robert A Duff
1996-10-19  0:00 ` Robert Dewar

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