Reviewed-by: Rich Salz <rsalz@openssl.org>
}
{ package register; # pick up registers, which start with %.
sub re {
}
{ package register; # pick up registers, which start with %.
sub re {
- my ($class, $line) = @_;
+ my ($class, $line, $opcode) = @_;
- # optional * ---vvv--- appears in indirect jmp/call
+ # optional * ----vvv--- appears in indirect jmp/call
if ($$line =~ /^(\*?)%(\w+)/) {
bless $self,$class;
$self->{asterisk} = $1;
$self->{value} = $2;
if ($$line =~ /^(\*?)%(\w+)/) {
bless $self,$class;
$self->{asterisk} = $1;
$self->{value} = $2;
+ $opcode->size($self->size());
$ret = $self;
$$line = substr($$line,@+[0]); $$line =~ s/^\s+//;
}
$ret = $self;
$$line = substr($$line,@+[0]); $$line =~ s/^\s+//;
}
my @args;
ARGUMENT: while (1) {
my @args;
ARGUMENT: while (1) {
- if ($arg=register->re(\$line)) { $opcode->size($arg->size()); }
- elsif ($arg=const->re(\$line)) { }
- elsif ($arg=ea->re(\$line, $opcode)) { }
- elsif ($arg=expr->re(\$line, $opcode)) { }
- else { last ARGUMENT; }
+ ($arg=register->re(\$line, $opcode))||
+ ($arg=const->re(\$line)) ||
+ ($arg=ea->re(\$line, $opcode)) ||
+ ($arg=expr->re(\$line, $opcode)) ||
+ last ARGUMENT;
- last ARGUMENT if ($line !~ /^,/);
+ last ARGUMENT if ($line !~ /^,/);
} # ARGUMENT:
if ($#args>=0) {
} # ARGUMENT:
if ($#args>=0) {