aboutsummaryrefslogtreecommitdiff
path: root/code16gcc.h
diff options
context:
space:
mode:
Diffstat (limited to 'code16gcc.h')
-rw-r--r--code16gcc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/code16gcc.h b/code16gcc.h
new file mode 100644
index 0000000..a4feb62
--- /dev/null
+++ b/code16gcc.h
@@ -0,0 +1,14 @@
+/*
+ * code16gcc.h
+ *
+ * This file is -include'd when compiling 16-bit C code.
+ * Note: this asm() needs to be emitted before gcc emits any code.
+ * Depending on gcc version, this requires -fno-unit-at-a-time or
+ * -fno-toplevel-reorder.
+ *
+ * Hopefully gcc will eventually have a real -m16 option so we can
+ * drop this hack long term.
+ */
+
+
+asm(".code16gcc");