summaryrefslogtreecommitdiff
path: root/tools/spasm/codegen.h
diff options
context:
space:
mode:
authorXavi Del Campo <xavi.dcr@tutanota.com>2020-01-31 10:32:23 +0100
committerXavi Del Campo <xavi.dcr@tutanota.com>2020-01-31 10:32:23 +0100
commit7c24e9a9b02b04dcaf9507acb94091ea70a2c02d (patch)
treec28d0748652ad4b4222309e46e6cfc82c0906220 /tools/spasm/codegen.h
parenta2b7b6bb1cc2f4a3258b7b2dbc92399d151f864d (diff)
downloadpsxsdk-7c24e9a9b02b04dcaf9507acb94091ea70a2c02d.tar.gz
Imported pristine psxsdk-20190410 from official repo
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