aboutsummaryrefslogtreecommitdiff
path: root/asm/main.c
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-31 20:39:49 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-31 20:39:49 +0000
commit7ca8f2c6445a902c681f4b871d15e0eda3724895 (patch)
tree57aae578ac42bb1bc612eb7fe3d840bcb34670dd /asm/main.c
parent75dc36cd197ab47ffd1dbbad887dd7bac88c8add (diff)
downloadovm-7ca8f2c6445a902c681f4b871d15e0eda3724895.tar.gz
ovm-7ca8f2c6445a902c681f4b871d15e0eda3724895.tar.bz2
ovm-7ca8f2c6445a902c681f4b871d15e0eda3724895.zip
asm/main logs are now indented and look prettier
Diffstat (limited to 'asm/main.c')
-rw-r--r--asm/main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/asm/main.c b/asm/main.c
index bfa12e0..07117ac 100644
--- a/asm/main.c
+++ b/asm/main.c
@@ -35,8 +35,13 @@ int main(int argc, char *argv[])
return 1;
}
- source_file = argv[1];
- out_file = argv[2];
+ source_file = argv[1];
+ out_file = argv[2];
+
+#if VERBOSE >= 1
+ printf("[%sASSEMBLER%s]: Assembling `%s` to `%s`\n", TERM_YELLOW, TERM_RESET,
+ source_file, out_file);
+#endif
FILE *fp = fopen(source_file, "rb");
darr_t buffer = darr_read_file(fp);
fclose(fp);
@@ -63,7 +68,7 @@ int main(int argc, char *argv[])
goto end;
}
#if VERBOSE >= 1
- printf("[%sTOKENISER%s]: %lu bytes -> %lu tokens\n", TERM_GREEN, TERM_RESET,
+ printf("\t[%sTOKENISER%s]: %lu bytes -> %lu tokens\n", TERM_GREEN, TERM_RESET,
buffer.used, tokens.available);
#endif
free(buffer.data);
@@ -87,7 +92,7 @@ int main(int argc, char *argv[])
goto end;
}
#if VERBOSE >= 1
- printf("[%sPARSER%s]: %lu tokens -> %lu instructions\n", TERM_GREEN,
+ printf("\t[%sPARSER%s]: %lu tokens -> %lu instructions\n", TERM_GREEN,
TERM_RESET, tokens.available, number);
#endif
@@ -95,7 +100,7 @@ int main(int argc, char *argv[])
insts_write_bytecode_file(instructions, number, fp);
fclose(fp);
#if VERBOSE >= 1
- printf("[%sCOMPILER%s]: Wrote bytecode to `%s`\n", TERM_GREEN, TERM_RESET,
+ printf("[%sASSEMBLER%s]: Wrote bytecode to `%s`\n", TERM_GREEN, TERM_RESET,
out_file);
#endif
end: