notaz.gp2x.de
/
ia32rtools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
60f7539
)
fix .text position, storm and stuff
author
notaz
<notasas@gmail.com>
Sun, 10 Nov 2013 18:28:06 +0000
(20:28 +0200)
committer
notaz
<notasas@gmail.com>
Sun, 10 Nov 2013 18:28:44 +0000
(20:28 +0200)
runimp.sh
patch
|
blob
|
blame
|
history
runsed.sh
patch
|
blob
|
blame
|
history
diff --git
a/runimp.sh
b/runimp.sh
index
25086c7
..
fd049d0
100755
(executable)
--- a/
runimp.sh
+++ b/
runimp.sh
@@
-2,7
+2,8
@@
grep 'extrn ' StarCraft.asm | awk '{print $2}' | awk -F: '{print $1}' > implist
grep 'extrn ' StarCraft.asm | awk '{print $2}' | awk -F: '{print $1}' > implist
-echo -n "" > tramp.s
+echo ".data" > tramp.s
+echo ".align 4" >> tramp.s
cat implist | while read i; do
rm -f tmpsym
cat implist | while read i; do
rm -f tmpsym
@@
-15,7
+16,7
@@
cat implist | while read i; do
;;
esac
;;
esac
- grep "\<_$si\>" /usr/i586-mingw32msvc/lib/lib* | awk '{print $3}' | \
+ grep "\<_$si\>" /usr/i586-mingw32msvc/lib/lib*
*.lib
| awk '{print $3}' | \
while read f; do
sym=`i586-mingw32msvc-nm $f | grep "\<_$si\>" | grep ' T ' | awk '{print $3}'`
if test -n "$sym"; then
while read f; do
sym=`i586-mingw32msvc-nm $f | grep "\<_$si\>" | grep ' T ' | awk '{print $3}'`
if test -n "$sym"; then
@@
-31,6
+32,6
@@
cat implist | while read i; do
echo ".globl $i" >> tramp.s
echo "$i:" >> tramp.s
echo ".globl $i" >> tramp.s
echo "$i:" >> tramp.s
- echo "
jmp
$sym" >> tramp.s
+ echo "
.long
$sym" >> tramp.s
echo >> tramp.s
done
echo >> tramp.s
done
diff --git
a/runsed.sh
b/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/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
' 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'