Reputation:
How different are assembly language for each type of processor?
If someone learns x86 intel assembly, will he have to start completely from the beginning if he would use assembly with another processor type (fx x86-64)?
Upvotes: 2
Views: 2815
Reputation: 71526
They are generally more similar than different. x86 is the last instruction set you want to learn, its not that great of an instruction set, pretty ugly. yes if you learn it the others are really easy, but it is better to learn a good instruction set first. And as your question implies, once you know one or two the others are a matter of syntax. msp430 is a good first instruction set, hardware is super cheap (under 5 dollars) or just use a simulator. supported in mainline binutils. arm and thumb are other good instruction sets to learn. likewise hardware is cheap, cortex-m3 based (thumb/thumb2 only no arm instructions) for about 10 bucks, arm/thumb (no thumb2) based for under 40. free simulators out there as well so you dont have to buy hardware.
Upvotes: 0
Reputation: 6473
Well, some of the concepts are similar. For example, all processor architectures have registers for quick temporary storage, all of them have an instruction pointer, and nearly all of them have a stack. In my experience, if you can handle x86 (and certainly amd64, which is more complex than just adding 32 bits), you you will be able handle simpler architectures like ARM, z80, or MIPS pretty quickly.
If you want to pick it up quickly, grab the free version of IDA or if you are in Windows there is also Ollydbg. Write a little program in C, and disassemble what you wrote. You will learn a ton that way (that is pretty much how I taught myself).
Also to note, as far as x86 there is two major assembly syntax flavors - Intel and AT&T. It seems the linux crowd tends to use AT&T syntax, but I prefer Intel personally.
Upvotes: 4
Reputation: 14427
It really depends on the particular assembly language. The difference between 32 and 64 bit x86 processors isn't too bad (extra registers, etc), but the difference between a 64 bit processor for a pc and an old flip-phone cell phone processor will be pretty darn different. In general though, most of the concepts will translate fairly well.
Upvotes: 3