14 lines
619 B
C
14 lines
619 B
C
|
|
#ifndef GLYPH_ASSEMBLER_H
|
||
|
|
#define GLYPH_ASSEMBLER_H
|
||
|
|
#include "../common/glyph_types.h"
|
||
|
|
#include "../common/glyph_decode.h"
|
||
|
|
#define MAX_TOKENS 8
|
||
|
|
#define MAX_LINE 512
|
||
|
|
#define MAX_LABELS 256
|
||
|
|
typedef struct { char name[64]; uint32_t address; } Label;
|
||
|
|
typedef struct { uint32_t code[MAX_CODE_SIZE]; uint32_t code_len; ExtSlot ext[MAX_EXT_SLOTS]; uint32_t ext_len; Label labels[MAX_LABELS]; uint32_t label_count; int pass; int errors; int line_num; const char *filename; } Assembler;
|
||
|
|
void asm_init(Assembler *as);
|
||
|
|
int asm_assemble(Assembler *as, const char *path);
|
||
|
|
int asm_write_gobj(Assembler *as, const char *path);
|
||
|
|
#endif
|