Subject: Re: MIT ChaosNet code port to Linux
From: (Rob Warnock)
Date: 29 Jun 2002 15:02:03 GMT
Newsgroups: comp.lang.lisp
Message-ID: <afki5b$4v3nn$>
Barry Margolin  <> wrote:
| Erik Naggum  <> wrote:
| >| 6-bit ASCII is only usable if you're willing to forego lowercase.
| >
| > Actually, there is no such thing as 6-bit ASCII. SIXBIT has no
| > control codes and is completely useless except in extremely
| > well-controlled settings.
| You're right, it's wrong to call it ASCII, it's just a 6-bit character set

"Right" or "wrong", DEC SIXBIT (mandated for filenames in PDP-10 system
calls [UUOs], among other things) *was* a strict subset of 7-bit ASCII,
with one bit inverted. Or to say it another way, the 7-bit ASCII characters
at codepoints #o40 through #o137 *were* the SIXBIT characters with values
0 through #o77.

To convert from ASCII to SIXBIT, you first upcased any alphabetics, then
complemented the #x20 (#o40) bit, and the low six bits of the result was
your SIXBIT character. In C, it would probably be something gross like:

	char6 = (((char7 < 0140) ? char7 : (char7 - 040)) ^ 040) & 077;

If memory serves, it was only three lines of PDP-10 assembler, using
those wonderful combined test-under-mask-and-modify-and-conditionally-skip

	; here with a 7-bit ASCII character in t0
	TRZE	t0, 100	; if alpha (and clear 7th bit unconditionally)
	TRZ	t0, 40	; upcase (zero) it
	TRC	t0, 40	; and in either case, complement
	; t0 now has the corresponding SIXBIT char


Rob Warnock, 30-3-510		<>
SGI Network Engineering		<>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA

[Note: and aren't for humans ]