OpenSSH does work now, but required -0, -1 and -2 specification.
[retty.git] / bytecode.pl
blobe40df85b9b7e113acedfff37b2cb3929f6b0f305
1 #!/usr/bin/perl
3 $state = 0;
4 while ($l = <STDIN>) {
5 chomp($l);
6 if (!$state && $l =~ /^[0-9a-f]* <.*>:/) {
7 $state++;
8 } elsif ($state) {
9 if ($l =~ /^\s*([0-9a-f]*):\t(.*)\t(.*)$/) {
10 $c = $1;
11 $a = $2;
12 $b = $3;
13 $a =~ s/[^0-9a-f]//g;
14 $a =~ s/([0-9a-f]{2})/0x\1,/g;
15 printf("/* %04s */\t%-30s\t/* \%s */\n", $c, $a, $b);
16 } elsif ($l =~ /^([0-9a-f]+) <(\S+)>:\s*$/) {
17 push (@id, [$2, $1]);
22 print "};\n";
23 foreach my $i (@id) {
24 my ($id, $ofs) = @$i;
25 print "poke_32($ARGV[0], 0x$ofs+1, fd_$id);\n";
27 print "{\n";