void output_hex(Selector sel, const char *work,
const Byte *command, int length);
+/*---------- from protocol.c ----------*/
+
+typedef struct OrdinaryPicMessage OrdinaryPicMessage;
+struct OrdinaryPicMessage {
+ const char *title;
+ unsigned opcode;
+ int operand_bits; /* 0: no operand. >=7, insn is a 2-byte message */
+};
+
/*---------- from hostside.c ----------*/
extern oop_source *events;
--- /dev/null
+#!/usr/bin/perl
+while (<>) {
+ $dirn= '<' if m/^From host to PIC/ ... m/^\S/;
+ $dirn= '>' if m/^From host to PIC/ ... m/^\S/;
+
+ $dirn= ? '>' :
+ m/^From PIC to host/ ... m/^\S/ ? '<' : undef;
+ next unless defined $dirn;
+ next unless m/^ [(<>)] / && $1 eq $dirn;
+ die if m/\t/;
+ die unless m/^ [<>] ([01A-Z. ]+?) +(?:\([A-Z]\))? (\S.*)$/;
+ $msg= $1; $rhs= $2;
+ next if $rhs =~ m/^\}/;
+ next if $msg =~ m/^\.\.\./;
+ $rhs =~ m/^([A-Z]+)\s/;
+ $cname= lc $1;
+ $msg =~ s/ //g;
+ if ($msg =~ m/^0[01]{7}$/) {
+ $opcode= $&;
+ $arglen= 0;
+ } else {
+ $msg =~ m/A-Z/;
+ $oplet= $&;
+ $msg =~ s/$oplet/_/g;
+ die if $msg =~ m/A-Z/;
+ die if $msg =~ m/_[01]/;
+ die unless $msg =~ m/^(1[01][01_]{6})0_{7}$/ or
+ $msg =~ m/^(0[01][01_]{6})$/;
+ $opcode= $1;
+ $arglen= $msg;
+ $arglen =~ s/[01]//g;
+ $arglen= length $arglen;
+ }
+ printf(" { %-16s, 0x%02x, %2d },",
+ "\"$cname\",", bin($opcode), $arglen)
+ or die $!;
+}