From b663f827057fc9fb199293bc1920cf27315d1846 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 9 Oct 2024 12:07:59 -0400 Subject: refactor elf32 assembler, add support for multiple isa's in cmdline --- masm/masm.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 masm/masm.h (limited to 'masm/masm.h') 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__ */ -- cgit v1.2.3-freya