From 82109a9cc3f967e24704760014f72d30461c504b Mon Sep 17 00:00:00 2001 From: julianb0 Date: Sun, 16 Jun 2019 20:26:30 +0200 Subject: [PATCH] att --- vm/pc/dump.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/vm/pc/dump.c b/vm/pc/dump.c index 0096f3e..65eed3d 100644 --- a/vm/pc/dump.c +++ b/vm/pc/dump.c @@ -33,30 +33,39 @@ void dump_instr(ctx_t *ctx, if (lock) log("lock"); -#if _ATT_STYLE == 0 log("%s", in->name); -#else - char s0[2] = {0,0}, s1[2] = {0, 0}, s2[2] = {0, 0}; - if (p1 && ACC_IS_MEM(p1)) { - s0[0] = ':'; - s1[0] = getmempref(p1->mlen); +#if _ATT_STYLE == 1 + if (p1 || p2) + { + int l1 = 8, l2 = 8; + + if (p1 && ACC_IS_MEM(p1)) { + l1 = p1->mlen; + } + + if (p2 && ACC_IS_MEM(p2)) { + l2 = p2->mlen; + } + + log("%c", getmempref(l1mlen); - } - - log("%s%s%s%s", in->name, s0, s1, s2); #endif if (rep) +#if _ATT_STYLE == 0 log(".rep"); +#else + log("$rep"); +#endif if (cond) { +#if _ATT_STYLE == 0 log("."); +#else + log("?"); +#endif if (cond & (1 << 4)) {