comp.lang.ada
 help / color / mirror / Atom feed
From: CONTR47@NOSC-TECR.ARPA.UUCP
Subject: Multiple abstractions of a register?
Date: Sat, 11-Apr-87 21:00:01 EST	[thread overview]
Date: Sat Apr 11 21:00:01 1987
Message-ID: <8704120153.AA18401@ucbvax.Berkeley.EDU> (raw)

Some inexpensive I/O devices use a totally different bit
definition of a register depending on whether you are
reading or writing the register. Therefore I would like to
have two abstractions of the register address, one for
reading and one for writing. e.g.:
--
type status_type is (ok, error);
  for status_type use (ok=>1, error=>2);
type command_type is (start, stop);
  for command_type use (start=> 1, stop => 2);
status : status_type;
command: command_type;
for status use at 16#3_FFF#;
for command use at 16#3_FFF#;
--
LRM 13.5 (8) seems to say this is illegal -
"Address clauses should not be used to achieve overlays of objects --"
   Does the LRM citation apply to my situation? Comments
and suggestions are welcome. Thanks in advance.
regards, sam harbaugh
---------------------
 

                 reply	other threads:[~1987-04-12  2:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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