added Register typedef
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 19 Apr 2021 17:14:19 +0000 (12:14 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 19 Apr 2021 17:14:19 +0000 (12:14 -0500)
bin/onyx
src/onyxc_output.c

index a4b2ea1475fa7b51c5d4838ee04787fdb56b7d01..de8d3eacb818be242071bcf233fbdae1984bb19e 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index d98f0b7d15f3ca185ba2677f50fd98d926b09af5..945a77d5d384bd46122b536348dc94679db5ca96 100644 (file)
@@ -16,9 +16,23 @@ static char* BOILERPLATE_TOP =
     "typedef double   f64;\n"
     "typedef void    *rawptr;\n";
 
-
+static char* REGISTER_DEFINITION =
+    "typedef union Register {\n"
+    "    u8 u8;\n"
+    "    i8 i8;\n"
+    "    i16 i16;\n"
+    "    u16 u16;\n"
+    "    i32 i32;\n"
+    "    u32 u32;\n"
+    "    i64 i64;\n"
+    "    u64 u64;\n"
+    "    f32 f32;\n"
+    "    f64 f64;\n"
+    "    rawptr rawptr;\n"
+    "} Register;";
 
 
 void onyx_output_c_file(OnyxCFile* cfile, bh_file file) {
     bh_file_write(&file, BOILERPLATE_TOP, strlen(BOILERPLATE_TOP));
+    bh_file_write(&file, REGISTER_DEFINITION, strlen(REGISTER_DEFINITION));
 }