Search code examples
assemblyoperating-systemprogramming-languagescpu-architecture

Is the assembly language different from one architecture to another?


I read that every processor has its own assembly language, so is every processor has it own assembly or every architecture? How OS and programming languages work on different assemblies?


Solution

  • The process of assembling code is to translate opcodes - expressed as text - into binary.

    Basically, you can say that each processor has its own instruction set. Binary code for a different processor will simply not run - or if the platform differences are only marginal, run and produce unexpected results (well, not really unexpected). This is why multiple install packages/CDs/DVDs for the very same program/OS exist for different platforms.

    E.g. gcc (GNU Compiler Collection) provides for the same release a variety of packages (see "Download gcc"), built from the same (high-level) source code, but for different hardware architectures.