aboutsummaryrefslogtreecommitdiffstats
path: root/microshmup/microshmup_core.S
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-10-23 20:52:14 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-10-23 20:52:14 -0500
commitd2bae67f79bea91e79b6175dcc41e2edb4644b0d (patch)
tree8074b3beefb442132cad950dc88a0f9a0c19f265 /microshmup/microshmup_core.S
parentd1b89258a63479db30514f96d02bdffdd2af118a (diff)
downloaddemos-d2bae67f79bea91e79b6175dcc41e2edb4644b0d.tar.gz
demos-d2bae67f79bea91e79b6175dcc41e2edb4644b0d.zip
Diffstat (limited to 'microshmup/microshmup_core.S')
-rw-r--r--microshmup/microshmup_core.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/microshmup/microshmup_core.S b/microshmup/microshmup_core.S
new file mode 100644
index 0000000..cbb8bfb
--- /dev/null
+++ b/microshmup/microshmup_core.S
@@ -0,0 +1,29 @@
+// ================================================================================================
+// Macros
+// ================================================================================================
+
+#ifdef __APPLE__
+# define LBL(name) L ## name
+# define SYM(name) _##name
+# define SECTION_BSS .section __DATA,__bss
+# define SECTION_RODATA .section __TEXT,__const
+# define SECTION_TEXT .section __TEXT,__text
+#else
+# define LBL(name) .L ## name
+# define SYM(name) name
+# define SECTION_BSS .section .bss
+# define SECTION_RODATA .section .rodata
+# define SECTION_TEXT .section .text
+#endif
+
+.macro LOADADDR reg, sym
+#ifdef __APPLE__
+ adrp \reg, \sym\()@PAGE
+ add \reg, \reg, \sym\()@PAGEOFF
+#else
+ adrp \reg, \sym
+ add \reg, \reg, :lo12:\sym
+#endif
+.endm
+
+