4 no warnings 'portable';
12 ($orm, $andm) = ($1, $1);
13 $andm =~ s/X/1/g; $andm = oct "0b$andm";
14 $orm =~ s/X/0/g; $orm = oct "0b$orm";
15 print "andm=$andm\n orm=$orm\n";
18 if (/mem\[(\d+)\] = (\d+)/) {
19 $mem[$1] = ($2 | $orm) & $andm;
20 print "mem[$1] = $2 => $mem[$1]\n";
25 for (@mem) { $sum += $_ if defined $_ };