I just started writing assembly language programs on linux(ubuntu) and know for a fact that I have a Intel processor. nasm use Intel like syntax and gas(GNU assembler) uses AT&T like syntax. But obviously my processor cannot understand AT&T syntax. So I was wondering how this compiler actually works behind the scenes? Does it take the file and convert the assembly language back to Intel syntax and then run it on my processor. If so , how does it know what processor I actually have?(Giving this doubt a little more thought, even when I install gcc, I dont tell it the type of processor I am using. How does it figure it out then?)
I just started writing assembly language programs on linux(ubuntu) and know for a fact
Share
Your processor cannot understand AT&T syntax or Intel syntax. That’s why you need an assembler. The purpose of an assembler is to convert from some syntax into instructions that your CPU will understand. The assembler does have to be told what instruction set to generate, unless it supports only a single instruction set.