Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!topaz!uwvax!husc6!harvard!panda!genrad!decvax!decwrl!joel From: joel@decwrl.UUCP Newsgroups: net.lang.mod2 Subject: Re: Bit stripping Message-ID: <4638@decwrl.DEC.COM> Date: Mon, 4-Aug-86 20:25:57 EDT Article-I.D.: decwrl.4638 Posted: Mon Aug 4 20:25:57 1986 Date-Received: Sat, 9-Aug-86 02:24:27 EDT Organization: DEC Western Software Lab, Palo Alto, CA Lines: 15 Keywords: bits modula-2 sets Yet another way to accomplish stripping off the parity bit is using set arithmetic. ch := char(bitset(ch) * bitset{0..6})) Of course, this may not generate great code either. Mike Powell's compiler for the VAX generates an extra mcoml instruction on the constant 127, rather than complementing at compile-time. (No AND instruction, just an AND NOT instruction on the VAX.) -- - Joel McCormack {ihnp4 decvax ucbvax allegra}!decwrl!joel joel@decwrl.arpa