diff options
author | Vladimir Menshakov | 2011-06-16 16:44:58 +0400 |
---|---|---|
committer | Vladimir Menshakov | 2011-06-16 16:44:58 +0400 |
commit | d8d16e0231272e73f72630c5a1966db6f1e29809 (patch) | |
tree | 3d04f5b8d2d0cc92b86cd63bf9fb469147047739 /devtools/tasmrecover/tasm | |
parent | 4fd3cdf984567221035537e4bcab6ff8499d2c4a (diff) | |
download | scummvm-rg350-d8d16e0231272e73f72630c5a1966db6f1e29809.tar.gz scummvm-rg350-d8d16e0231272e73f72630c5a1966db6f1e29809.tar.bz2 scummvm-rg350-d8d16e0231272e73f72630c5a1966db6f1e29809.zip |
DREAMWEB: removed while loops from rep+stos/movs instructions
Diffstat (limited to 'devtools/tasmrecover/tasm')
-rw-r--r-- | devtools/tasmrecover/tasm/proc.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 3c4ac21372..1350ea1e0b 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -34,6 +34,9 @@ class proc: if not isinstance(stmts[i], cls): i += 1 continue + if i > 0 and isinstance(stmts[i - 1], op._rep): #skip rep prefixed instructions for now + i += 1 + continue j = i + 1 while j < len(stmts): @@ -49,6 +52,17 @@ class proc: else: i = j + i = 0 + while i < len(stmts): + if not isinstance(stmts[i], op._rep): + i += 1 + continue + if i + 1 >= len(stmts): + break + if isinstance(stmts[i + 1], cls): + stmts[i + 1].repeat = 'context.cx' + del stmts[i] + i += 1 return def optimize(self): |