1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/perl -w $_ = <>; chomp; for(split /, */, $_) { s/, *//; s/0x//; my $out = sprintf("%08b", hex($_)); $out =~ s/1/X/g; $out =~ s/0/ /g; print "$out\n"; }