comp.lang.ada
 help / color / mirror / Atom feed
From: mcsun!news.funet.fi!funic!news.eunet.fi!prime!mits!rkaivola@uunet.uu.net  (Risto Kaivola)
Subject: Record representation on MC680X0
Date: 18 Jul 93 21:07:02 GMT	[thread overview]
Message-ID: <rkaivola.743029622@mits> (raw)

  I'm interested in the approach to record representation clauses that
Ada vendors for systems based on Motorola's MC680x0 line have taken,
especially for the 68020 and higher.  Specifically, I'm interested in
the convention used in numbering the bits in component clauses.
  As you probably know, these processors store the most significant
byte of an integer value first, so that if the 16-bit value 16#1234#
is stored at the address 0, it looks like

address ->      0        1 
byte value-> 16#12#   16#34#

The bit numbering for normal purposes would be as follows:

address                 ->|            0         |              1         |
                                                 |
byte bit number         -> 7  6  5  4  3  2  1  0|  7  6  5  4  3  2  1  0

16-bit word bit number  -> 15 14 13 12 11 10 9  8|  7  6  5  4  3  2  1  0

bit value               -> 0  0  0  1  0  0  1  0|  0  0  1  1  0  1  0  0


On the other hand, Motorola also define a 'bit-field' bit numbering, which
is as follows (for the same value):

address                 ->             0         |              1

byte bit number (bit f.)-> 0  1  2  3  4  5  6  7|  0  1  2  3  4  5  6  7

16-bit word bit # (b.f.)-> 0  1  2  3  4  5  6  7|  8  9  10 11 12 13 14 15

bit value               -> 0  0  0  1  0  0  1  0|  0  0  1  1  0  1  0  0


Now, at first sight, the first numbering scheme might seem more natural
for implementations targeting Motorola-based systems.  But I think it is
somewhat problematic, or at least confusing for components whose size is
greater than 8 bits.
  I would like to know which numbering scheme your favourite
implementation uses (by default, if more than scheme is available through
pragmas).

--
Risto Kaivola
(Internet address:   rkaivola@mits.mdata.fi)

             reply	other threads:[~1993-07-18 21:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-18 21:07 Risto Kaivola [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-07-19 13:54 Record representation on MC680X0 cis.ohio-state.edu!news.sei.cmu.edu!ae
1993-07-20 17:31 magnesium.club.cc.cmu.edu!news.sei.cmu.edu!ae
1993-07-21 18:58 agate!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!news.umbc.edu!
replies disabled

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