> It just requires being aware of a few differences between the Mach-O and ELF ABIs, as well as knowing what Apple-specific syntax extensions to avoid.
And completely ignoring PE and Windows on ARM.
How is this code portable to other platforms if it assumes that clang implies macOS?
[flagged]
Assembly was never portable, or do you think 6502 on Apple would work out of the box in a Gameboy or C64?
> You will also need to be aware of minor differences between the Darwin ABI and other platform ABIs. A notable example is that the x18 register is reserved by the Darwin ABI and is explicitly zeroed on context switches in some cases. This register is also reserved on Android, but not on GNU/Linux or Alpine.
x18 is "the platform register", reserved for the OS. The ISA manual says not to touch it unless you know what you're doing. Also, I don't know but I could believe that android and non-googly linux use different ABIs (but probably not because everyone uses pretty much the same ABI on aarch64 from what I've seen), but surely Alpine is linux and has the same ABI as other linuxes.