Assembly and Architecture Compatibility

4

I have no experience with the assembly low-level language.

What does it take to get the most out of cross platform with this language?

I mean, if I focus only on AMD64 (x86-64) will I get compatibility with all current computers?

    
asked by anonymous 29.06.2014 / 19:27

1 answer

6
Each processor architecture has its own Assembly language, it has been so since the beginning of modern computers in the 1940s. The only way to better exploit an architecture is to create a way to use it in a very specific way. Assembly is not cross platform by definition. If this is required, use C.

Well, in fact each architecture has a different machine code, which makes the Assembly different. It is possible to have different syntaxes for the same architecture.

There are currently hundreds or even thousands of architectures in use. Of course nobody learns all. The most common is to learn only one or two, perhaps three.

Learning multiple languages Assembly is not difficult. It is difficult to be very good at several. And there is not much space in the market for those who are not very good. Let's remember that today's Assembly is almost useless in any task.

And even if you focus on an architecture you may need to learn different Assembly syntaxes. There are assemblers that prefer a different syntax to do the same thing. For x86 there is the Intel syntax and AT & T syntax . But the syntax is the least of the worries.

The most widely used architectures today are sharply x86_64 ( majority of desktops ) and mobiles in>). In a way the second has already surpassed the first.

All other architectures added do not come close to these two. But some may be more important to Assembly. Embedded device architectures, which are usually not widely used, still continue to use Assembly as the primary language. This has changed a lot. More and more C or C ++ is used in these cases but the Assembly is common.

The Assembly language has absolute link to the processor and nothing else. Operating systems do not affect the Assembly itself. Of course you may have to deal with their specificities but for other reasons and not the language. Example:

  • If you are not using an assembler (I doubt it) you will need to know the format of the operating system executable file.
  • Accessing the operating system's API (processes, files, GUI, etc.) is always done specifically for it but does not belong to the language.

Note that if you are not writing a backend of a compiler, knowing only the Assembly is the tip of the iceberg . Even in this case, the Assembly is only a part of the knowledge needed.

Learning Assembly is very useful for understanding the operation of the computer, to have a hobby but today its practical use has greatly reduced. It is rarely used even to produce operating systems or drivers . Outside compilers / JITters (anyway, not all types), bootstrap , and some architecture which has no other language, Assembly is absolutely unnecessary.

    
29.06.2014 / 21:09