comp.lang.ada
 help / color / mirror / Atom feed
From: Ramesh Sadasivam <madurai@erols.com>
Cc: ramesh@eagle.bgm.link.com
Subject: Ada95: at clause - 'Address
Date: 1996/10/18
Date: 1996-10-18T00:00:00+00:00	[thread overview]
Message-ID: <3267958B.41C6@erols.com> (raw)


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




             reply	other threads:[~1996-10-18  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-18  0:00 Ramesh Sadasivam [this message]
1996-10-18  0:00 ` Ada95: at clause - 'Address Robert A Duff
1996-10-19  0:00 ` Robert Dewar
replies disabled

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