Moved asmspetok enum to arch
authorLukas Krickl <lukas@krickl.dev>
Mon, 19 Feb 2024 16:49:24 +0000 (17:49 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 19 Feb 2024 16:49:24 +0000 (17:49 +0100)
src/archs.h
src/ulas.h

index 7a5342c88bce4f48ef4d02cd01b1dc82ae7c35f4..83b4e41c9f4242ec52c619eb256105dc0a95413b 100644 (file)
@@ -1,6 +1,13 @@
 #ifndef ARCHS_H_
 #define ARCHS_H_
 
+/**
+ * Insturction table:
+ * It is simply a table of all possible instructions for
+ * the architecture.
+ * 0 means the list has ended
+ */
+
 enum ulas_asmregs_sm83 {
   // r8
   ULAS_REGSM83_B = 1,
@@ -37,6 +44,20 @@ enum ulas_asmregs_sm83 {
   ULAS_SM83_REGS_LEN
 };
 
+// special asm tokens for instr enum
+// TODO: add more expressions types such as e8, e16, e24, e32, e64
+// as well as the corresponding addresses
+// Use ULAS_DATZERO if an actual byte is expected to appear in the assembly
+// output (since 0 denotes the end of the list)
+enum ulas_asmspetok {
+  ULAS_E8 = -1,
+  ULAS_E16 = -2,
+  // A8 is like E8, but it will not emit an overflow warning
+  // because it is commont to pass a 16-bit label as a value
+  ULAS_A8 = -3,
+  ULAS_DATZERO = 0xFF00
+};
+
 enum ulas_archs { ULAS_ARCH_SM83 };
 
 struct ulas_arch {
index 98b823d6023a5d175d25795843db8a3a1c999f01..747c5e1ea3352dd74cf3c542d2168631e19bc298 100644 (file)
@@ -422,17 +422,6 @@ enum ulas_asmdir {
   ULAS_ASMDIR_REP,
 };
 
-// special asm tokens for instr enum
-// TODO: add more expressions types such as e8, e16, e24, e32, e64
-// as well as the corresponding addresses
-enum ulas_asmspetok {
-  ULAS_E8 = -1,
-  ULAS_E16 = -2,
-  // A8 is like E8, but it will not emit an overflow warning
-  // because it is commont to pass a 16-bit label as a value
-  ULAS_A8 = -3,
-  ULAS_DATZERO = 0xFF00
-};
 
 #define ULAS_INSTRTOKMAX 16
 #define ULAS_INSTRDATMAX 16