summaryrefslogtreecommitdiff
path: root/masm/masm.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-10-09 12:07:59 -0400
committerFreya Murphy <freya@freyacat.org>2024-10-09 12:07:59 -0400
commitb663f827057fc9fb199293bc1920cf27315d1846 (patch)
tree477b481694ad50f28bac538bb9b301861b3af4d6 /masm/masm.h
parentupdate generator to support multipe isas, expand grammer syntax (diff)
downloadmips-b663f827057fc9fb199293bc1920cf27315d1846.tar.gz
mips-b663f827057fc9fb199293bc1920cf27315d1846.tar.bz2
mips-b663f827057fc9fb199293bc1920cf27315d1846.zip
refactor elf32 assembler, add support for multiple isa's in cmdline
Diffstat (limited to 'masm/masm.h')
-rw-r--r--masm/masm.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/masm/masm.h b/masm/masm.h
new file mode 100644
index 0000000..75a63f8
--- /dev/null
+++ b/masm/masm.h
@@ -0,0 +1,45 @@
+/* Copyright (c) 2024 Freya Murphy */
+
+#ifndef __MASM_H__
+#define __MASM_H__
+
+// isa to asemble for
+enum isa {
+ ISA_MIPS1, // a.k.a mipsR2000
+ ISA_MIPS32R2,
+ ISA_MIPS32R6,
+};
+
+// abi to mark output object
+enum abi {
+ ABI_O32, // mips o32 abi
+ ABI_NONE, // no flag output
+};
+
+// format for the object file
+enum format {
+ FORMAT_ELF32,
+};
+
+// defines arguments
+struct arguments {
+ // files to read from and
+ // write to
+ char *in_file;
+ char *out_file;
+
+ // if undefined symbols should
+ // be treated as extern
+ bool extern_undefined;
+
+ // isa to assemble for
+ enum isa isa;
+
+ // abi to mark object
+ enum abi abi;
+
+ // format to output
+ enum format format;
+};
+
+#endif /* __ASM_H__ */