Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Bitwise EXOR
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Herman Stevens  
View profile  
 More options Sep 24 1990, 1:52 am
Newsgroups: comp.lang.modula2
From: Herman.Stev...@p21701.f601.n292.z2.fidonet.org (Herman Stevens)
Date: 24 Sep 90 05:52:29 GMT
Local: Mon, Sep 24 1990 1:52 am
Subject: Bitwise EXOR
Hello there !

I am a beginner with Modula-II. I work on an Amiga with the M2Amiga
compiler. I fail to see how I can do a bitwise EXOR, something you
can easily write in C as :

         tmpbuf[i] = inbuf[i]^key[kp]

Can someone help me on this ?
Tnx,
     Herman

--  
uucp: uunet!m2xenix!puddle!2!292!601.21701!Herman.Stevens
Internet: Herman.Stev...@p21701.f601.n292.z2.fidonet.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Funk  
View profile  
 More options Oct 1 1990, 7:12 am
Newsgroups: comp.lang.modula2
From: p...@artcom0.north.de (Peter Funk)
Date: 1 Oct 90 11:12:14 GMT
Local: Mon, Oct 1 1990 7:12 am
Subject: Re: Bitwise EXOR
Herman.Stev...@p21701.f601.n292.z2.fidonet.org (Herman Stevens) writes:

[...]
hs> ......... I fail to see how I can do a bitwise EXOR, something you
hs> can easily write in C as :

hs>          tmpbuf[i] = inbuf[i]^key[kp]

hs> Can someone help me on this ?

Bit-Operations are usually coded in Modula-2 using the Type BITSET:
Assume : VAR b1, b2, b3 : BITSET;

        b3 := b1 * b2;     <-->     b3 <- b1 AND b2;
        b3 := b1 + b2;     <-->     b3 <- b1 OR  b2;
        b3 := b1 - b2;     <-->     b3 <- b1 AND NOT b2;
        b3 := b1 / b2;     <-->     b3 <- b1 XOR b2;

So your problem may be solved typing :
             tmpbuf [i] := yourType (BITSET(inbuf [i]) / BITSET(key [kp]));
where 'yourType' is the element data type of 'tmpbuf'.

Gruss, Peter
-->
Peter Funk \\ ArtCom GmbH, Schwachhauser Heerstr. 78, D-2800 Bremen 1
Work at home: Oldenburger Str.86, D-2875 Ganderkesee 1 /+49 4222 6018 (8am-6pm)

>> PLEASE Don't send BIG mails (oversea) ! I've to pay for it : $0.3/kB

   Don't use the bang path of this news article for mails (They will bounce).
   Only the address '...@artcom0.north.de' will work. Thank You ! <<

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »