aboutsummaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-14 17:09:49 +0630
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-14 17:09:49 +0630
commit98d4f73134ac90ab12d023affa829ebd2937e592 (patch)
tree93cab25e991ab60509c8d4fa3301dbc38de2ba3d /asm
parent44305138b0688cd644cc48d4d97a08084d3a589e (diff)
downloadovm-98d4f73134ac90ab12d023affa829ebd2937e592.tar.gz
ovm-98d4f73134ac90ab12d023affa829ebd2937e592.tar.bz2
ovm-98d4f73134ac90ab12d023affa829ebd2937e592.zip
asm/main now prints usage
Diffstat (limited to 'asm')
-rw-r--r--asm/main.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/asm/main.cpp b/asm/main.cpp
index 1ad17b1..17023e7 100644
--- a/asm/main.cpp
+++ b/asm/main.cpp
@@ -10,10 +10,24 @@
* Description: Entrypoint for assembly program
*/
+#include <cstdio>
#include <iostream>
-int main(void)
+#include <lib/inst.h>
+
+#include "./lexer.hpp"
+
+void usage(const char *program_name, FILE *fp)
+{
+ fprintf(fp,
+ "Usage: %s FILE OUT-FILE\n"
+ "\tFILE: Source code to compile\n"
+ "\tOUT-FILE: Name of file to store bytecode\n",
+ program_name);
+}
+
+int main(int argc, const char *argv[])
{
- std::cout << "Hello, world!" << std::endl;
+ usage(argv[1], stdout);
return 0;
}