I would like to start learning assembler. The first question I ask myself is this : when I sit in front of a computer, how to find out which assembly syntax I have to use?
I read many terms on internet as "ABI", "computer architecture", "processor", "compiler" but ultimately I didn't understand what exactly determines the syntax of the assembly language I have to use.
For instance I have a Mac M1 and I installed a Linux virtual machine. I checked my architecture which is AArch64 so I wrote a very simple assembly program :
.global _start
.section .text
_start:
mov x8, #0x5d
mov x0, #0x41
.section .data
For example, this works (compiled with gcc
) on my Linux virtual machine but not on the mac directly (also compiled with gcc) because apparently I have to replace .section .data
by .data
or .section .text
by .text
. So here I have the same AArch64 architecture and the same compiler, yet the assembly syntax is different... weird.
In short, I would like to know what exact information do I have to look for on a computer (ABI? Architecture? Something else?) in order to know for sure which assembly language syntax to use.