mips/masm/asm.h

34 lines
737 B
C

/* Copyright (c) 2024 Freya Murphy */
#ifndef __ASM_H__
#define __ASM_H__
#include <stddef.h>
struct str_table {
char *ptr;
size_t size;
};
/* initalize a string table */
void strtbl_init(struct str_table *str_tbl);
/* free a string table */
void strtbl_free(struct str_table *str_tbl);
/* get a string form the string table */
int strtbl_get_str(struct str_table *str_tbl, const char *str, size_t *res);
/* get or append a string into the string table */
int strtbl_write_str(struct str_table *str_tbl, const char *str, size_t *res);
struct assembler {
struct parser *parser;
struct str_table str_tbl;
};
/* assemble a mips32 file*/
int assemble_file_mips32(char *path);
#endif /* __ASM_H__ */