From: notaz Date: Wed, 27 Nov 2013 01:12:28 +0000 (+0200) Subject: begin pulling in disassembly, fix stuff X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a51421fac74994697dcfd507336eac414a334199;p=ia32rtools.git begin pulling in disassembly, fix stuff --- diff --git a/run_idac_adj.sh b/run_idac_adj.sh new file mode 100755 index 0000000..3ec98c6 --- /dev/null +++ b/run_idac_adj.sh @@ -0,0 +1,15 @@ +#!/bin/sh -x +set -e + +f=/tmp/sedcmd_ +echo -n "sed -i '\ +s:__cdecl: /* __cdecl*/:;\ +s:__stdcall: /*__stdcall*/:;\ +s:__usercall: /*__usercall*/:;\ +s:__userpurge: /* __userpurge*/:;\ +s:__thiscall: /* __thiscall*/:;\ +s:__fastcall: /*__fastcall*/:;\ +s:\(<[^>]*>\):/*\1*/:g;\ +' $1" > $f +. $f + diff --git a/tools/mkbridge.c b/tools/mkbridge.c index 6a2962e..4c70246 100644 --- a/tools/mkbridge.c +++ b/tools/mkbridge.c @@ -238,8 +238,8 @@ static void out_toasm_x86(FILE *f, char *sym, char *reg_list[], int reg_cnt, must_save |= is_x86_reg_saved(reg_list[i]); } - fprintf(f, ".global _asm_%s\n", sym); - fprintf(f, "_asm_%s:\n", sym); + fprintf(f, ".global _%s\n", sym); + fprintf(f, "_%s:\n", sym); if (!have_regs && !is_stdcall) { fprintf(f, "\tjmp %s\n\n", sym); @@ -288,7 +288,7 @@ static void out_toasm_x86(FILE *f, char *sym, char *reg_list[], int reg_cnt, fprintf(f, "\tcall %s\n\n", sym); if (args_repushed && !is_stdcall) - fprintf(f, "\tadd %d,%%esp\n", args_repushed * 4); + fprintf(f, "\tadd $%d,%%esp\n", args_repushed * 4); // restore regs for (i = reg_cnt - 1; i >= 0; i--) { @@ -348,7 +348,7 @@ static void out_fromasm_x86(FILE *f, char *sym, char *reg_list[], int reg_cnt, fprintf(f, "\n\tcall _%s\n\n", sym); if (sarg_ofs > 2) - fprintf(f, "\tadd %d,%%esp\n", (sarg_ofs - 2) * 4); + fprintf(f, "\tadd $%d,%%esp\n", (sarg_ofs - 2) * 4); fprintf(f, "\tpopl %%edx\n");