comp.lang.ada
 help / color / mirror / Atom feed
* bit shift
@ 2002-02-25 14:03 Stephen Frackelton
  2002-02-25 15:09 ` Jim Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stephen Frackelton @ 2002-02-25 14:03 UTC (permalink / raw)


does a bit shift operation / mechanism exist in ada83 ?
i'm doing some checksum algorithm work and want to cyclically rotate bits a
number of places within a word.






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

* Re: bit shift
  2002-02-25 14:03 bit shift Stephen Frackelton
@ 2002-02-25 15:09 ` Jim Rogers
  2002-02-25 15:25   ` A Interfaces package for '83? Petter Fryklund
                     ` (2 more replies)
  2002-02-25 17:20 ` John McCabe
  2002-02-25 18:08 ` Robert Dewar
  2 siblings, 3 replies; 9+ messages in thread
From: Jim Rogers @ 2002-02-25 15:09 UTC (permalink / raw)


Look in the package Interfaces.
That package contains the functions
Shift_Left
Shift_Right
Shift_Right_Arithmetic
Rotate_Left
Rotate_Right

Jim Rogers

Stephen Frackelton wrote:

> does a bit shift operation / mechanism exist in ada83 ?
> i'm doing some checksum algorithm work and want to cyclically rotate bits a
> number of places within a word.
> 
> 
> 
> 




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

* A Interfaces package for '83?
  2002-02-25 15:09 ` Jim Rogers
@ 2002-02-25 15:25   ` Petter Fryklund
  2002-02-25 20:27   ` bit shift Ted Dennison
  2002-02-25 22:59   ` Frank J. Lhota
  2 siblings, 0 replies; 9+ messages in thread
From: Petter Fryklund @ 2002-02-25 15:25 UTC (permalink / raw)


Is there really any?





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

* Re: bit shift
  2002-02-25 14:03 bit shift Stephen Frackelton
  2002-02-25 15:09 ` Jim Rogers
@ 2002-02-25 17:20 ` John McCabe
  2002-02-25 18:08 ` Robert Dewar
  2 siblings, 0 replies; 9+ messages in thread
From: John McCabe @ 2002-02-25 17:20 UTC (permalink / raw)


On Mon, 25 Feb 2002 14:03:32 -0000, "Stephen Frackelton"
<stephen.frackelton@baesystems.com> wrote:

>does a bit shift operation / mechanism exist in ada83 ?
>i'm doing some checksum algorithm work and want to cyclically rotate bits a
>number of places within a word.

There is nothing defined in the Ada 83 LRM to provide this facility
directly, but there is often a package provided by your compiler
vendor that will do it. In TLD Mil-Std-1750A compiler there was a
package called (I think) BITS. Look in your compiler documentation and
you may find something.

As a matter of interest, what compiler are you using?




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

* Re: bit shift
  2002-02-25 14:03 bit shift Stephen Frackelton
  2002-02-25 15:09 ` Jim Rogers
  2002-02-25 17:20 ` John McCabe
@ 2002-02-25 18:08 ` Robert Dewar
  2002-02-26  9:19   ` John McCabe
  2 siblings, 1 reply; 9+ messages in thread
From: Robert Dewar @ 2002-02-25 18:08 UTC (permalink / raw)


"Stephen Frackelton" <stephen.frackelton@baesystems.com> wrote in message news:<3c7a442c$1@pull.gecm.com>...
> does a bit shift operation / mechanism exist in ada83 ?
> i'm doing some checksum algorithm work and want to
> cyclically rotate bits a
> number of places within a word.

No it does not, ignore the answer you got from 
Jim Rogers, he ignored the ada83 in your question.

Not that I blame him, at this stage, seven years after
the Ada 95 standard has been issued, it seems a pity
that anyone has to struggle with the use of an obsolete
language :-)



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

* Re: bit shift
  2002-02-25 15:09 ` Jim Rogers
  2002-02-25 15:25   ` A Interfaces package for '83? Petter Fryklund
@ 2002-02-25 20:27   ` Ted Dennison
  2002-02-25 21:47     ` Jim Rogers
  2002-02-25 22:59   ` Frank J. Lhota
  2 siblings, 1 reply; 9+ messages in thread
From: Ted Dennison @ 2002-02-25 20:27 UTC (permalink / raw)


Jim Rogers <jimmaureenrogers@worldnet.att.net> wrote in message news:<3C7A5391.60206@worldnet.att.net>...
> Look in the package Interfaces.

...which doesn't exist for Ada83, I'm afraid.

> Stephen Frackelton wrote:
> 
> > does a bit shift operation / mechanism exist in ada83 ?

---
T.E.D.



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

* Re: bit shift
  2002-02-25 20:27   ` bit shift Ted Dennison
@ 2002-02-25 21:47     ` Jim Rogers
  0 siblings, 0 replies; 9+ messages in thread
From: Jim Rogers @ 2002-02-25 21:47 UTC (permalink / raw)


Right. I did overlook the Ada83 bit. I must get my new
prescription filled for my glasses.

You can implement a Right_Shift by dividing by multiples of
2. This does, however, require that the value being shifted
is an integer type. That is the most common situation for
bit shifting.

Left shifting becomes a significant problem using a signed
integer.

Jim Rogers

Ted Dennison wrote:

> Jim Rogers <jimmaureenrogers@worldnet.att.net> wrote in message news:<3C7A5391.60206@worldnet.att.net>...
> 
>>Look in the package Interfaces.
>>
> 
> ...which doesn't exist for Ada83, I'm afraid.
> 
> 
>>Stephen Frackelton wrote:
>>
>>
>>>does a bit shift operation / mechanism exist in ada83 ?
>>>
> 
> ---
> T.E.D.
> 




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

* Re: bit shift
  2002-02-25 15:09 ` Jim Rogers
  2002-02-25 15:25   ` A Interfaces package for '83? Petter Fryklund
  2002-02-25 20:27   ` bit shift Ted Dennison
@ 2002-02-25 22:59   ` Frank J. Lhota
  2 siblings, 0 replies; 9+ messages in thread
From: Frank J. Lhota @ 2002-02-25 22:59 UTC (permalink / raw)


"Jim Rogers" <jimmaureenrogers@worldnet.att.net> wrote in message
news:3C7A5391.60206@worldnet.att.net...
> Look in the package Interfaces.
> That package contains the functions
> Shift_Left
> Shift_Right
> Shift_Right_Arithmetic
> Rotate_Left
> Rotate_Right

Yes, but Interfaces was added in 95. The sad fact is that modular types,
bitwise operations, and shifts were not part of the Ada 83 definition.






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

* Re: bit shift
  2002-02-25 18:08 ` Robert Dewar
@ 2002-02-26  9:19   ` John McCabe
  0 siblings, 0 replies; 9+ messages in thread
From: John McCabe @ 2002-02-26  9:19 UTC (permalink / raw)


On 25 Feb 2002 10:08:25 -0800, dewar@gnat.com (Robert Dewar) wrote:

>Not that I blame him, at this stage, seven years after
>the Ada 95 standard has been issued, it seems a pity
>that anyone has to struggle with the use of an obsolete
>language :-)

As you may remember, one of the big deals about Ada was
maintainability and, as you may also remember, one of the other big
deals was about using it for projects that are likely to have a
lifespan of decades rather than the few weeks that you get with other
fly-by-night language based projects :-) So it is not surprising that
there are a significant number of people out there who will be
required to maintain and enhance Ada 83 systems without risking the
jump to Ada 95.



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

end of thread, other threads:[~2002-02-26  9:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-25 14:03 bit shift Stephen Frackelton
2002-02-25 15:09 ` Jim Rogers
2002-02-25 15:25   ` A Interfaces package for '83? Petter Fryklund
2002-02-25 20:27   ` bit shift Ted Dennison
2002-02-25 21:47     ` Jim Rogers
2002-02-25 22:59   ` Frank J. Lhota
2002-02-25 17:20 ` John McCabe
2002-02-25 18:08 ` Robert Dewar
2002-02-26  9:19   ` John McCabe

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