blob: c1e44f00e1fb5daf1b141309f6a736e18fbc2124 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/usr/bin/perl -w
while(<>) {
chomp;
#$was = $_;
s/$/ / while length($_) < 8;
s/X/1/g;
s/ /0/g;
#warn "was '$was', now '$_'\n";
push @out, sprintf("0x%02x", eval "0b$_");
}
print join(", ", @out) . "\n";
|