+/*
+ * ia32rtools
+ * (C) notaz, 2013,2014
+ *
+ * This work is licensed under the terms of 3-clause BSD license.
+ * See COPYING file in the top-level directory.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "my_assert.h"
#include "my_str.h"
+#include "common.h"
struct sl_item {
char *name;
return buf;
}
-#define IS(w, y) !strcasecmp(w, y)
#define IS_OR2(w, x, y) (IS(w, x) || IS(w, y))
#define IS_OR3(w, x, y, z) (IS(w, x) || IS(w, y) || IS(w, z))
p = next_word(word3, sizeof(word3), p);
// push offset <sym>
- // jcc short <sym>
- if ( (IS(word, "push") && IS(word2, "offset"))
- || (word[0] == 'j' && IS(word2, "short") && !IS(word3, "exit")) ) {
+ if (IS(word, "push") && IS(word2, "offset")) {
ssym.name = word3;
sym = bsearch(&ssym, symlist, symlist_cnt,
sizeof(symlist[0]), cmp_sym);
}
}
+ // jcc short <sym>
+ if (word[0] == 'j' && IS(word2, "short") && !IS(word3, "exit")) {
+ ssym.name = word3;
+ sym = bsearch(&ssym, symlist, symlist_cnt,
+ sizeof(symlist[0]), cmp_sym);
+ if (sym != NULL) {
+ fprintf(fout, "\t\t%s ", word);
+ // for conditional "call", don't print 'short'
+ if (IS(word3, func))
+ fprintf(fout, "short ");
+ fprintf(fout, "%s%s",
+ sym_use(sym, sym->callsites || IS(word3, func)), p);
+ continue;
+ }
+ }
+
// dd offset <sym>
if (IS(word, "dd")
&& (IS(word2, "offset") || strstr(p, "offset")))