X-Git-Url: http://git.megacz.com/?p=org.ibex.classgen.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fclassgen%2FCGConst.java;h=e67218c9a9422e003f40c3bf337ea6145a5582de;hp=cfef6b73a904379dab5ff84f6bddfabce281dbc3;hb=50a344886756b00af0e30d548a7a86822ef7e962;hpb=bc9112573cba51be5e7d285ccd3e496be4278c63 diff --git a/src/org/ibex/classgen/CGConst.java b/src/org/ibex/classgen/CGConst.java index cfef6b7..e67218c 100644 --- a/src/org/ibex/classgen/CGConst.java +++ b/src/org/ibex/classgen/CGConst.java @@ -82,11 +82,11 @@ public interface CGConst { public static final byte BALOAD = (byte) 0x33; // 0 public static final byte CALOAD = (byte) 0x34; // 0 public static final byte SALOAD = (byte) 0x35; // 0 - public static final byte ISTORE = (byte) 0x36; // 0 - public static final byte LSTORE = (byte) 0x37; // 9 - public static final byte FSTORE = (byte) 0x38; // 0 - public static final byte DSTORE = (byte) 0x39; // 0 - public static final byte ASTORE = (byte) 0x3A; // 0 + public static final byte ISTORE = (byte) 0x36; // 1 + public static final byte LSTORE = (byte) 0x37; // 1 + public static final byte FSTORE = (byte) 0x38; // 1 + public static final byte DSTORE = (byte) 0x39; // 1 + public static final byte ASTORE = (byte) 0x3A; // 1 public static final byte ISTORE_0 = (byte) 0x3B; // 0 public static final byte ISTORE_1 = (byte) 0x3C; // 0 public static final byte ISTORE_2 = (byte) 0x3D; // 0 @@ -235,23 +235,23 @@ public interface CGConst { /* #!/usr/bin/perl -w -@ARGV || push @ARGV,$0; +@ARGV || push @ARGV, $0; my @a = (); while(<>) { chomp; next unless(m|byte ([A-Z0-9_]+) = .*?([0-9xA-F]+);\s+//\s*(.*)$|i); - my ($name,$num) = ($1,hex($2)); + my ($name, $num) = ($1, hex($2)); $_ = $3; - my $n = 1; - $n |= (s/^(\d+)// ? $1 : (s/^V//||die,7)) << 1; + my $n = 1<<5; + $n |= s/^(\d+)// ? $1 : (s/^V//||die, 7); $n |= (1<<4) if(s/^C//); - $n |= (1<<5) if(s/^B//); + $n |= (1<<3) if(s/^B//); die if(/./); $a[$num] = $n; } print "private static final byte[] OP_DATA = {\n\t"; for(my $i=0;$i<256;$i++) { - printf "0x%02x%s", $a[$i]||2, $i==255?"\n};\n":($i%16)==15?",\n\t":", "; + printf "0x%02x%s", $a[$i]||1, $i==255?"\n};\n":($i%16)==15?", \n\t":", "; } __END__ */