diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-10-23 20:52:14 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-10-23 20:52:14 -0500 |
| commit | 35c4fbebeb3531b84dd0952aefd5d399046c00cb (patch) | |
| tree | 8074b3beefb442132cad950dc88a0f9a0c19f265 /microshmup/microshmup_core.S | |
| parent | 498b575a5262305f2c41d5c06baafc976ded48d1 (diff) | |
| download | demos-35c4fbebeb3531b84dd0952aefd5d399046c00cb.tar.gz demos-35c4fbebeb3531b84dd0952aefd5d399046c00cb.zip | |
microshmup: split into multiple files
Diffstat (limited to 'microshmup/microshmup_core.S')
| -rw-r--r-- | microshmup/microshmup_core.S | 29 |
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 + + |
