summaryrefslogtreecommitdiff
path: root/tools/spasm/codegen.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/spasm/codegen.h')
-rw-r--r--tools/spasm/codegen.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/spasm/codegen.h b/tools/spasm/codegen.h
new file mode 100644
index 0000000..e9e0ab7
--- /dev/null
+++ b/tools/spasm/codegen.h
@@ -0,0 +1,33 @@
+#ifndef _SPASM_CODEGEN_H
+#define _SPASM_CODEGEN_H
+
+typedef struct
+{
+ char name[128];
+ unsigned int pc;
+ unsigned int pass;
+}asm_label;
+
+extern asm_label *labels;
+
+extern volatile unsigned int curPc;
+extern int curPass;
+extern unsigned int numLabels;
+extern unsigned int startAddress;
+extern unsigned int copn;
+extern int first_instruction;
+extern int org_found;
+extern void (*INSFUNC)(void);
+
+void codegen_init(void);
+void add_label(char *label, unsigned int pc);
+void add_label_equ(char *label, unsigned int pc);
+unsigned int find_label(char *label);
+void find_label_reset();
+int find_label_ok();
+int label_was_not_found_once(char *name);
+void add_not_found_label(char *name);
+//void resolve_labels();
+
+
+#endif