# HG changeset patch # User Takahiro SHIMIZU # Date 1543306072 -32400 # Node ID 6c1384a939a03bdce3238da7222fe57eb15bc5a7 # Parent 2e4c952bcdfba05d82108142dc1acc7180931221 add tran2opcode.pl diff -r 2e4c952bcdfb -r 6c1384a939a0 trans2opcode.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trans2opcode.pl Tue Nov 27 17:07:52 2018 +0900 @@ -0,0 +1,20 @@ +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/lib"; +use OPCODE2Function; + +my $input = shift; #or die 'use input cur_op'; +chomp $input; + +if ( $input =~ /^\d+$/){ + print OPCODE2Function->codes($input)."\n"; +} else { + my $ref = OPCODE2Function->name2bitecode($input); + if (ref($ref ) eq "ARRAY"){ + map { print "$_\n";} @$ref; + } else { + print "$_\n"; + } +}