What assembly language to learn

I'm interested in learning Assembly, especially because I find the polymorphic code quite interesting, and I'm a little confused about what I have to learn.

I heard that x86 is the most common to learn or start with it, but not most applications (written in Visual Studio) in another assembly language? Or in a common intermediate language or something like that? Or CIL or IL or everything compiled in x86 at runtime?

+6
source share
4 answers

It depends on what you want to know. CIL is an assembly language for a theoretical machine (or virtual machine) called the CLR , which is implemented in software. The CIL code is then compiled by the on-time compiler into an x86 assembly or a 64-bit assembly.

If you are mainly programming in Visual Studio, I would recommend that you first study CIL for the following reasons:

1) CIL is much simpler. The x86 build has evolved since the 1970s, and it really shows. The number of instructions is huge, and you will need to study irrelevant technical details to get started.

2) It will be easier to write well-structured programs. If you later decide to explore the x86 build, I hope you take these habits with you.

3) CIL will be more useful if you ever want to configure your .NET programs at a low level, as this is what they are compiled to. This is the last place you need to optimize.

Reasons to study x86 / x64:

1) This is assembly language for real equipment. This means that what you learn will be "real." You will also learn a lot about how the actual equipment works. This does not mean that at first it would not be easy to learn a simpler language.

2) There are registers on the platform that you cannot recognize using CIL.

3) The platform does not have built-in object-oriented functions, which means that you will need to learn how to implement them yourself. This is something you can also learn about through C ++.

In general, I would recommend learning a simple language like CIL, JVM assembly, or LC-3 assembly, as Daniel Wolfe suggested. If you also want to learn about x86 builds, you can always do this after that. Learning how to in the correct order is probably easier than just learning the x86 assembly yourself.

+5
source

If you are really interested in learning assembler, the book I would recommend is An Introduction to Computer Systems . The authors teach assembly language for a computer system, which they invented on their own, like LC-3. There is no value for learning this platform in itself, but it is a significantly simplified machine language. Once you understand a simpler machine language, you can move on to learning more complex languages ​​such as x86.

+2
source

IL is not an assembler, it is an intermediate language and yes, it is compiled by the .NET environment in assembler. Assembler (or machine code) is the only language the processor speaks.

.NET assemblies are not written or generated in assembler, these are very different things.

I think the x86 Assembler should be fine if you really want to give yourself all this pain or make such an effort; -)

+1
source

What kind of computer chip architecture do you usually work or want to work the most? Which platform or OS do you usually work with?

This is important when programming in assembly.

PC and Windows? Mac? Unix? Linux or BSD running on PC (x86), Linux or BSD running on Solaris Sparc?

There are several ways to learn assembly language.

Typically, for a single-chip architecture, there is only one assembler language, and not as several high-level programming languages.

Another, as already mentioned, is the use of a “virtual machine”, as those already mentioned in previous answers: JMV, dotNet CIL or MSIL (its own), P-code, etc.

And in this case, it doesn’t matter which platform you use.

The PC has ASM, but you can also use a derivation called NASM:

http://www.nasm.us/

http://en.wikipedia.org/wiki/Netwide_Assembler

+1
source

Source: https://habr.com/ru/post/897526/


All Articles