comp.lang.ada
 help / color / mirror / Atom feed
* Bit manipulation
@ 2000-11-07  0:00 Sandro Binetti
  2000-11-07  0:00 ` gdemont
                   ` (2 more replies)
  0 siblings, 3 replies; 71+ messages in thread
From: Sandro Binetti @ 2000-11-07  0:00 UTC (permalink / raw)


 Hi,
is there anyone who can help me with bit manipulation on objects like
integers or character?

Which way may I shift bits, or maskerade them?

--
Ciao, Sandro


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 71+ messages in thread
* Bit manipulation
@ 2005-02-07 12:37 Maurizio
  2005-02-07 13:20 ` Martin Krischik
                   ` (3 more replies)
  0 siblings, 4 replies; 71+ messages in thread
From: Maurizio @ 2005-02-07 12:37 UTC (permalink / raw)


hi, i need two hint:

i need to acces to a 32 bit word (Interfaces.Unsigned_32).
how i can do to take the three m.s.bit? (30,31,32)

second, i need to send the 32 bit word over a Tcp connection to a C
program, but
socket work with usigned 8 bit word, so i need to split the 32 bit in
4 8bit word,
and when i read from the socket take 4 8bit word and combine in a 32
word.

i see that Ada.Unchecked_Conversion work (in an ada client/server test
program)  but is correct?

--com_buffer_type is an array of  128 32bit word 

subtype Datas is Ada.Streams.Stream_Element_Array(1..512); --128*4

function To_Raw is 
   new Ada.Unchecked_Conversion
      (
      Source => Com_Buffer_Type,  --Interfaces.Unsigned_32
      Target => Datas);     --Stream_Element is mod 2 **
Standard'Storage_Unit

   function From_Raw is 
   new Ada.Unchecked_Conversion
      (
      Source => Datas,                   
      Target => Com_Buffer_Type);

----------------------
best regards
Maurizio



^ permalink raw reply	[flat|nested] 71+ messages in thread
* bit manipulation
@ 1999-04-04  0:00 Jack Chow
  1999-04-04  0:00 ` Matthew Heaney
  1999-04-05  0:00 ` dennison
  0 siblings, 2 replies; 71+ messages in thread
From: Jack Chow @ 1999-04-04  0:00 UTC (permalink / raw)


Can anyone tell me how to do bit manipulation such as bitwise-and and
bitwise or?

I am a C programmer.

Thanks in advance.

Jack Chow







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

end of thread, other threads:[~2005-02-08 18:51 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-07  0:00 Bit manipulation Sandro Binetti
2000-11-07  0:00 ` gdemont
2000-11-08  7:22   ` Sandro Binetti
2000-11-07  0:00 ` Larry Kilgallen
2000-11-07  0:00   ` John English
2000-11-08  0:00   ` gdemont
2000-11-08  0:00     ` Robert Dewar
2000-11-08  0:00       ` Sandro Binetti
2000-11-08  0:00         ` Nicolas Brunot
2000-11-08  0:00         ` gdemont
2000-11-09  4:00           ` Ken Garlington
2000-11-09  0:00             ` Larry Kilgallen
2000-11-09  0:00               ` Ken Garlington
2000-11-08  0:00         ` Dale Stanbrough
2000-11-09  0:00           ` Sandro Binetti
2000-11-09  0:00             ` Ken Garlington
2000-11-09  0:00             ` gdemont
2000-11-10  0:00             ` Scott Ingram
2000-11-09  3:59         ` Ken Garlington
2000-11-09  4:52         ` Robert Dewar
2000-11-08  0:00       ` gdemont
2000-11-08  0:00         ` Larry Kilgallen
2000-11-09  4:50           ` Robert Dewar
2000-11-10  0:00             ` Lao Xiao Hai
2000-11-09  4:47         ` Robert Dewar
2000-11-09  0:00           ` gdemont
2000-11-11  0:00       ` Redryder
2000-11-11  0:00         ` Jeff Carter
2000-11-11  0:00           ` Redryder
2000-11-12  2:07             ` Ken Garlington
2000-11-12  5:56             ` Jeff Carter
2000-11-12  0:00               ` Robert Dewar
2000-11-12  0:00                 ` tmoran
2000-11-13  0:00                   ` Robert Dewar
2000-11-14  0:00                     ` Marc A. Criley
2000-11-13  0:54                   ` Ken Garlington
2000-11-12  6:40               ` tmoran
2000-11-13  0:00         ` Lutz Donnerhacke
2000-11-13  0:00           ` Robert Dewar
2000-11-13  0:00             ` Lutz Donnerhacke
2000-11-13  0:00               ` Robert Dewar
2000-11-13  0:00                 ` Lutz Donnerhacke
2000-11-13  0:00           ` Robert Dewar
2000-11-13  0:00             ` Lutz Donnerhacke
2000-11-13  0:00               ` Robert Dewar
2000-11-13  0:00                 ` Lutz Donnerhacke
2000-11-13  0:00                   ` Pat Rogers
2000-11-13  0:00                     ` Brian Rogoff
2000-11-13  0:00                       ` F. Britt Snodgrass
2000-11-15  0:00                         ` Lutz Donnerhacke
2000-11-13  0:00                       ` Pat Rogers
2000-11-14  0:00                       ` Georg Bauhaus
2000-11-15  0:00                         ` Lutz Donnerhacke
2000-11-14  0:00                   ` Martin Dowie
2000-11-15  0:00                     ` Lutz Donnerhacke
2000-11-20  0:00                 ` Randy Brukardt
2000-11-21  0:00                   ` Lutz Donnerhacke
2000-11-21  0:00                     ` Stephen Leake
2000-11-22  0:00                       ` Lutz Donnerhacke
2000-11-08  7:18   ` Sandro Binetti
2000-11-10  7:24 ` Thank you all for your contribution ! Sandro Binetti
  -- strict thread matches above, loose matches on Subject: below --
2005-02-07 12:37 Bit manipulation Maurizio
2005-02-07 13:20 ` Martin Krischik
2005-02-07 15:32 ` Martin Dowie
2005-02-07 18:04   ` Martin Krischik
2005-02-08  0:32 ` Randy Brukardt
2005-02-08  3:11 ` Steve
2005-02-08 18:51   ` tmoran
1999-04-04  0:00 bit manipulation Jack Chow
1999-04-04  0:00 ` Matthew Heaney
1999-04-05  0:00 ` dennison

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