🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.mod2
Article #499

Re: Bit stripping

#499
From: joel
Date: Tue, 05 Aug 1986 00:25
14 lines
971 bytes
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
Technical Details
Message-ID: <4638@decwrl.DEC.COM>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!topaz!uwvax!husc6!harvard!panda!genrad!decvax!decwrl!joel

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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