comp.lang.ada
 help / color / mirror / Atom feed
* rep clause confusion
@ 2002-01-01  1:25 chris.danx
  2002-01-01  5:23 ` Ted Dennison
  2002-01-03 16:24 ` Jerry Petrey
  0 siblings, 2 replies; 3+ messages in thread
From: chris.danx @ 2002-01-01  1:25 UTC (permalink / raw)


Hi,

I've been looking at rep clauses(?), for laying seg descriptors for the x86,
and one thing confuses me.

for some_type
    use record
        abc        at 0 range 0..7;
        def        at 1 range 0..7;
    end record;

The 'at' bit confuses me.  Does this mean the storage element (numbered from
zero)?  If so that means, abc spans storage element zero bits 0..7 and def
spans storage element 1 bits 0..7.  Is this correct?


Happy New Year,
Chris





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

* Re: rep clause confusion
  2002-01-01  1:25 rep clause confusion chris.danx
@ 2002-01-01  5:23 ` Ted Dennison
  2002-01-03 16:24 ` Jerry Petrey
  1 sibling, 0 replies; 3+ messages in thread
From: Ted Dennison @ 2002-01-01  5:23 UTC (permalink / raw)


In article <ed8Y7.27607$4x4.3341820@news2-win.server.ntlworld.com>, chris.danx
says...
>for some_type
>    use record
>        abc        at 0 range 0..7;
>        def        at 1 range 0..7;
>    end record;
>
>The 'at' bit confuses me.  Does this mean the storage element (numbered from
>zero)?  If so that means, abc spans storage element zero bits 0..7 and def
>spans storage element 1 bits 0..7.  Is this correct?

Yes. Think of them as offsets in storage elements (usually bytes) from the start
of the record.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html

No trees were killed in the sending of this message. 
However a large number of electrons were terribly inconvenienced.



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

* Re: rep clause confusion
  2002-01-01  1:25 rep clause confusion chris.danx
  2002-01-01  5:23 ` Ted Dennison
@ 2002-01-03 16:24 ` Jerry Petrey
  1 sibling, 0 replies; 3+ messages in thread
From: Jerry Petrey @ 2002-01-03 16:24 UTC (permalink / raw)




"chris.danx" wrote:
> 
> Hi,
> 
> I've been looking at rep clauses(?), for laying seg descriptors for the x86,
> and one thing confuses me.
> 
> for some_type
>     use record
>         abc        at 0 range 0..7;
>         def        at 1 range 0..7;
>     end record;
> 
> The 'at' bit confuses me.  Does this mean the storage element (numbered from
> zero)?  If so that means, abc spans storage element zero bits 0..7 and def
> spans storage element 1 bits 0..7.  Is this correct?
> 
> Happy New Year,
> Chris


Yes, the value after AT gives a storage unit (as defined in package System -
in this case, apparently a byte) and it can extend outside the storage unit.
You could have written the following with the same results:

 for some_type
     use record
         abc        at 0 range 0..7;
         def        at 0 range 8..15;
     end record;


Jerry

-- 
-----------------------------------------------------------------------------
-- Jerry Petrey                                                
-- Senior Principal Systems Engineer - Navigation, Guidance, & Control
-- Raytheon Missile Systems          - Member Team Ada & Team Forth
-- NOTE: please remove <NOSPAM> in email address to reply                  
-----------------------------------------------------------------------------



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

end of thread, other threads:[~2002-01-03 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-01  1:25 rep clause confusion chris.danx
2002-01-01  5:23 ` Ted Dennison
2002-01-03 16:24 ` Jerry Petrey

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