fix .text position, storm and stuff
[ia32rtools.git] / runsed.sh
index c2821ba..ba98e54 100755 (executable)
--- a/runsed.sh
+++ b/runsed.sh
@@ -16,6 +16,16 @@ s/^\(loc[r_].*[0-9A-F]:\)[^:]\(.*\;\)/\1:\t\2/g;\
 s/dd[[:blank:]]rva/dd/;\
 s/\<fldcw\>\t\[esp+4+var_4\]/fldcw\tword ptr \[esp\]/;\
 s/\<large \(.*fs:\)/\1/;\
+s/lea\t\(e.[px]\), \[\1+0\]/align 10h/;\
+s/\[\(e..\)+\(e.p\)\]/\[\2+\1\]/;\
+s/\(\<word_.*\), 0FFFFh/\1, word ptr 0FFFFh/;\
+s/\(\<j[mn]\?[abceglopszp]e\?\>\)\tloc_/\1\tnear ptr loc_/;\
 ' StarCraft.asm" >> $f
 . $f
 
+# manual fixup:
+# = 'end start' -> 'end'
+# - 'lea     ecx, [ecx+0]' -> align
+# - add 'near ptr' to some jumps
+# - 'cmp     [ebp+edx+0], cl' -> 'cmp     [edx+ebp+0], cl'
+# - 0FFFFh constant - masm treats a byte, sometimes prefix with 'word ptr'