From 76874ad7c301864861842705142c8b0e6d07f7d5 Mon Sep 17 00:00:00 2001 From: julianb0 Date: Sun, 16 Jun 2019 19:44:34 +0200 Subject: [PATCH] att style for the lol --- vm/pc/dump.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/vm/pc/dump.c b/vm/pc/dump.c index f3e3822..5421680 100644 --- a/vm/pc/dump.c +++ b/vm/pc/dump.c @@ -32,8 +32,22 @@ void dump_instr(ctx_t *ctx, if (lock) log("lock"); +#ifndef _ATT_STYLE + log("%s\t", in->name); +#else + char s1[2] = {0, 0}, s2[2] = {0, 0}; + + if (p1 && ACC_IS_MEM(p1)) + s1[0] = getmempref(p1->mlen); + + if (p2 && ACC_IS_MEM(p2)) + s2[0] = getmempref(p2->mlen); + + log("%s%s%s\t", in->name, s1, s2); +#endif + if (rep) - log(" rep"); + log(".rep"); if (cond) { @@ -57,37 +71,20 @@ void dump_instr(ctx_t *ctx, log("\t"); #ifndef _ATT_STYLE - log("%s\t", in->name); - - if (p1) { dump_acc(ctx, p1); - if (p2) { log(", "); dump_acc(ctx, p2); } } - #else - char s1[2] = {0, 0}, s2[2] = {0, 0}; - - if (p1 && ACC_IS_MEM(p1)) - s1[0] = getmempref(p1->mlen); - - if (p2 && ACC_IS_MEM(p2)) - s2[0] = getmempref(p2->mlen); - - log("%s%s%s\t", in->name, s1, s2); - - if (p1) { if (p2) { dump_acc(ctx, p2); log(", "); } - dump_acc(ctx, p1); - } #endif + } log("\n"); }