How I generated the code above.How I generated the code above:
#!/usr/bin/env perl
# Usage: perl $0 STRING
# Generates a code that stores given STRING
# to ;1 array in CLC-INTERCAL's binary IO model
# so it can be output by DOREADOUT;1,
# without spaces.
my $line = shift;
my @values = unpack("C*", $line);
my $ptr = 0;
my @val = ();
my $io = 172;
for my $datum (@values) {
my $chr = $datum;
my $chr0 = $chr;
my $bits0 = 0;
my $bits1 = 0;
for (my $i = 0; $i < 8; $i++) {
if ($io & 0x80) {
$bits0 <<= 1;
$bits0 |= 1 if $chr & 0x80;
} else {
$bits1 <<= 1;
$bits1 |= 1 if ! ($chr & 0x80);
}
$chr <<= 1;
$io <<= 1;
}
$chr = int(rand 0xffff) + 1;
for (my $i = 0; $i < 8; $i++) {
$chr <<= 2;
$chr |= 2 if $bits0 & 0x80;
$chr |= 1 if $bits1 & 0x80;
$bits0 <<= 1;
$bits1 <<= 1;
}
$datum = $chr;
$io = $chr0;
}
print "DO;1<-#" . @values;
for my$i(0..$#values) {
my $clcii = $i + 1;
my $x = $values[$i] & 0xffff;
print 'DO,1SUB#' . $clcii . '<-#' . $x if $x;
}