'Assembly language - More than one type?

I start university in a few weeks (software engineering degree) and know that one of the modules I'll be studying in the first year is 'fundamentals of architecture' or something similar; basically it's learning to program in 'assembly'.

I'm wanting to do some background learning so I'm prepared for it (I've done the same on some other units), but don't know if there is more than one 'assembly language'. How many are there? Is it one per manufacturer, a 32-bit and 64-bit language, or just one standard?

If there is more than one type, what is the most 'popular' or likely to be taught at university level?



Solution 1:[1]

but don't know if there is more than one 'assembly language'

Different assemblers (e.g. Gnu's and Microsoft's) for the same CPU may have different assembly language syntax; but the difference is trivial, because they're both targeting the same CPU, and there's a 1-to-1 mapping (if you ignore macros) between assembly instructions and CPU opcodes.

The bigger difference is between different types of CPU.

Sometimes different CPU support the same opcodes (and can therefore be targeted by the same assemblers), because they're designed to be compatible with or competitive against each other, by executing the same machine language.

But sometimes they're different: see List of Instruction Set Architectures.

Solution 2:[2]

In general:

  • there must be at least one completely different assembly language for each different type of CPU (because assembly language is directly related to machine code).

  • for each of those there may be 2 or more categories of assembly language (e.g. "Intel syntax" vs. "AT&T syntax").

  • for each of those there may be many dialects, with minor variations in the syntax for instructions, completely different pre-processors and completely different directives.

If (using random numbers pulled out of thin air) you assume that there are 50 different types of CPUs, an average of 1.5 categories in use for each CPU, and an average of 2 dialects per category; then it'd work out to 150 different assembly languages.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ChrisW
Solution 2 EJoshuaS - Stand with Ukraine