summaryrefslogtreecommitdiff
path: root/nqdasm.c
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-15 12:51:08 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-15 23:19:33 -0600
commitf38a18c10bcb7cfd5ce76a7216686b2631789fee (patch)
tree70aae3b6c12deed3f2f87421f30e8f4176055e0f /nqdasm.c
parent9acd6ce40559c59ca55899215aa9d7e781b5a8b7 (diff)
nqdasm: improve spacing between mnemonic and operands
Diffstat (limited to 'nqdasm.c')
-rw-r--r--nqdasm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nqdasm.c b/nqdasm.c
index 4969f47..a2ff732 100644
--- a/nqdasm.c
+++ b/nqdasm.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <string.h>
#include "mnemonics.h"
@@ -33,7 +34,8 @@ int main()
printf("\t%s", m->mnem);
for (int i = 0; i < 3 && m->operands[i].type; i++) {
- printf("%s", i ? ", " : " ");
+ if (i) printf(", ");
+ else printf("%*s", 8 - (int)strlen(m->mnem), "");
print_operand(bits, m->operands + i);
}
printf("\n");