Is assembly language assembly language too specific? Which assembler is better?

I am learning assembly language. I started with Paul A. Carter PC Assembly Language, who uses NASM (The Netwide Assembler). Then in the middle I switched and started reading Introduction to 80×86 Assembly Language and Computer Architecture, which uses MASM.

In NASM, I used to write to initialize a byte

db 110101b

In MASM, I use

BYTE 110101b

I'm in the middle of reading. Since these are assembler directives, they will be different for each assembler. correctly? Don't these assembler developers follow the standard for these directives? Because, They know that mnemonics are processor specific. So, his pain in the ass to learn and code in assembly language.

Now, if they follow different directives, the more painful it is if you change the assembler or switch to the operating system (the MASM developer experiences deep problems if it goes to Linux).

My confusion is that I get to know NASM or MASM? I am a fan of windows, but I may have to work on Linux in the future.

Each book should have the title "_________ Assembly Language Using __________ Assembler"

+5
source share
4 answers

Unfortunately, there has never been a standard for assembler. You just need to study the directives that your assembler supports. Fortunately, most directives, having different names, are semantically similar, for example, db and BYTE.

! , x86. ( ) , : Intel AT & T. AT & T ( );

NASM, , , GNU ..

+4

Intel/AT & T

x86, , Intel, Microsoft .

( , - ) , 8, 16 32- , opcode . ( ) .

Unix , .

Unix AT & T, , Bell Labs. BSD, Linux . , , , , cpp , .

, , VS MS Gnu Linux Mac, AT & T vs Intel. GNU , AT & T.

+2

- . , , .

+1

, . ( , ) . , .

, . .

Your best bet: choose a notation that suits you best and accept books with different syntaxes, see if you can find cross-system macro libraries or translation tools, or bite a bullet and learn several dialects. The third is generally tolerant, although it makes creating private libraries time-consuming.

+1
source

All Articles