From 35c4fbebeb3531b84dd0952aefd5d399046c00cb Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Fri, 23 Oct 2026 20:52:14 -0500 Subject: microshmup: split into multiple files --- microshmup/microshmup_core.S | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 microshmup/microshmup_core.S (limited to 'microshmup/microshmup_core.S') 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 + + -- cgit v1.2.3