|
@@ -174,11 +174,15 @@ class Statement:
|
|
|
'dmfc1']
|
|
'dmfc1']
|
|
|
use = []
|
|
use = []
|
|
|
|
|
|
|
|
|
|
+ # Jump to register addres uses register
|
|
|
|
|
+ if self.is_command('j') and re.match('^\$\d+$', self[0]):
|
|
|
|
|
+ use.append(self[0])
|
|
|
|
|
+
|
|
|
# Case arg0
|
|
# Case arg0
|
|
|
if (self.is_branch() \
|
|
if (self.is_branch() \
|
|
|
- and not self.is_command(*['bc1f', 'bc1t', 'bct', 'bcf'])) \
|
|
|
|
|
|
|
+ and not self.is_command('bc1f', 'bc1t', 'bct', 'bcf')) \
|
|
|
or self.is_store() or self.is_compare() \
|
|
or self.is_store() or self.is_compare() \
|
|
|
- or self.is_command(*['mult', 'dsz', 'mtc1']):
|
|
|
|
|
|
|
+ or self.is_command('mult', 'dsz', 'mtc1'):
|
|
|
if self.name == 'dsz':
|
|
if self.name == 'dsz':
|
|
|
m = re.match('^[^(]+\(([^)]+)\)$', self[0])
|
|
m = re.match('^[^(]+\(([^)]+)\)$', self[0])
|
|
|
|
|
|
|
@@ -186,27 +190,29 @@ class Statement:
|
|
|
use.append(m.group(1))
|
|
use.append(m.group(1))
|
|
|
else:
|
|
else:
|
|
|
use.append(self[0])
|
|
use.append(self[0])
|
|
|
- # Case arg1 direct adressing
|
|
|
|
|
|
|
+
|
|
|
if (self.is_branch() and not self.is_branch_zero() \
|
|
if (self.is_branch() and not self.is_branch_zero() \
|
|
|
- and not self.is_command(*['bc1f', 'bc1t', 'bct', 'bcf'])) \
|
|
|
|
|
|
|
+ and not self.is_command('bc1f', 'bc1t', 'bct', 'bcf')) \
|
|
|
or self.is_shift() \
|
|
or self.is_shift() \
|
|
|
or self.is_double_arithmetic() or self.is_double_unary() \
|
|
or self.is_double_arithmetic() or self.is_double_unary() \
|
|
|
or self.is_logical() or self.is_convert() \
|
|
or self.is_logical() or self.is_convert() \
|
|
|
or self.is_truncate() or self.is_set_if_less() \
|
|
or self.is_truncate() or self.is_set_if_less() \
|
|
|
or self.is_compare() or self.is_command(*instr):
|
|
or self.is_compare() or self.is_command(*instr):
|
|
|
|
|
+ # Case arg1 direct adressing
|
|
|
use.append(self[1])
|
|
use.append(self[1])
|
|
|
- # Case arg1 relative adressing
|
|
|
|
|
- if self.is_load_non_immediate() or self.is_store():
|
|
|
|
|
|
|
+ elif self.is_load_non_immediate() or self.is_store():
|
|
|
|
|
+ # Case arg1 relative adressing
|
|
|
m = re.match('^[^(]+\(([^)]+)\)$', self[1])
|
|
m = re.match('^[^(]+\(([^)]+)\)$', self[1])
|
|
|
|
|
|
|
|
if m:
|
|
if m:
|
|
|
use.append(m.group(1))
|
|
use.append(m.group(1))
|
|
|
else:
|
|
else:
|
|
|
use.append(self[1])
|
|
use.append(self[1])
|
|
|
|
|
+
|
|
|
# Case arg2
|
|
# Case arg2
|
|
|
if self.is_double_arithmetic() or self.is_set_if_less() \
|
|
if self.is_double_arithmetic() or self.is_set_if_less() \
|
|
|
or self.is_logical() or self.is_truncate() \
|
|
or self.is_logical() or self.is_truncate() \
|
|
|
- or self.is_command(*['addu', 'subu', 'div']):
|
|
|
|
|
|
|
+ or self.is_command('addu', 'subu', 'div'):
|
|
|
if not isinstance(self[2], int):
|
|
if not isinstance(self[2], int):
|
|
|
use.append(self[2])
|
|
use.append(self[2])
|
|
|
|
|
|