I've seen examples of Hello World program in Assembly, one in MacOS and the other in Linux. But the difference between them is that MacOS uses absolute memory location for system calls and Linux doesn't. Why is that? Why MacOS can't just use 1
or whatever number the kernel uses for system call write
?
; MacOS
mov rax, 0x02000004 ; system call for write
; Linux
mov rax, 1 ; system call for write