X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Fasmproc.c;h=6f1e3d58f8c9085a7d2c737577791b2d895692de;hb=c0d9cac631f101c5e13152ae21d5b9b5d5200fba;hp=678f58feaa01535e6ea6cdd6f31750a87acdee1f;hpb=87ccd363f88828840d1bc7c4614ee3b3eb0dba54;p=ia32rtools.git diff --git a/tools/asmproc.c b/tools/asmproc.c index 678f58f..6f1e3d5 100644 --- a/tools/asmproc.c +++ b/tools/asmproc.c @@ -193,7 +193,7 @@ int main(int argc, char *argv[]) } } - if (IS_OR3(word, "call", "jmp", "public")) { + if (IS_OR2(word, "call", "jmp")) { ssym.name = word2; sym = bsearch(&ssym, symlist, symlist_cnt, sizeof(symlist[0]), cmp_sym); @@ -206,6 +206,16 @@ int main(int argc, char *argv[]) } } + if (IS(word, "public")) { + ssym.name = word2; + sym = bsearch(&ssym, symlist, symlist_cnt, + sizeof(symlist[0]), cmp_sym); + if (sym != NULL) { + fprintf(fout, "\t\tpublic %s%s", sym_use(sym), p); + continue; + } + } + p = sskip(p); if (*p == 0 || *p == ';') goto pass; // need at least 3 words @@ -229,9 +239,11 @@ int main(int argc, char *argv[]) } // dd offset - if (IS(word, "dd") && IS(word2, "offset")) { + if (IS(word, "dd") + && (IS(word2, "offset") || strstr(p, "offset"))) + { fprintf(fout, "\t\tdd"); - strcpy(word, word3); + p = next_word(word, sizeof(word), line); goto offset_loop; } @@ -242,9 +254,12 @@ int main(int argc, char *argv[]) p = next_word(word4, sizeof(word4), p); // dd offset - if (IS(word2, "dd") && IS(word3, "offset")) { + if (IS(word2, "dd") + && (IS(word3, "offset") || strstr(p, "offset"))) + { fprintf(fout, "%s\tdd", word); - strcpy(word, word4); + p = next_word(word, sizeof(word), line); + p = next_word(word, sizeof(word), p); goto offset_loop; } @@ -294,6 +309,19 @@ pass: offset_loop: while (1) { + p2 = next_word(word, sizeof(word), p); + if (word[0] == 0 || word[0] == ';') { + break; + } + if (!IS(word, "offset")) { + // pass through + p2 = strstr(p, "offset"); + if (p2 == NULL) + break; + fwrite(p, 1, p2 - p, fout); + p2 = next_word(word, sizeof(word), p2); + } + p = next_word(word, sizeof(word), p2); p2 = strchr(word, ','); if (p2) *p2 = 0; @@ -304,16 +332,6 @@ offset_loop: fprintf(fout, " offset %s%s", (sym != NULL && sym->callsites) ? sym_use(sym) : word, p2 ? "," : ""); - - p2 = next_word(word, sizeof(word), p); - if (word[0] == 0 || word[0] == ';') { - break; - } - if (!IS(word, "offset")) { - printf("could not handle offset array\n"); - break; - } - p = next_word(word, sizeof(word), p2); } fprintf(fout, "%s", p); continue;