Skip to main content
Engineering LibreTexts

1.4: What is Assembly Language?

  • Page ID
    83037
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Most readers have probably programmed in a HLL like C/C++ or Java. These are called compiled languages because there is a program, called a compiler, that takes the information that is contained in a source code file and compiles it together with lots of other information and produces an output that the CPU can understand. For example, in a HLL the data type is remembered for variables, and when an operator is applied to the variable the compiler figures out the correct type of operator (e.g., integer add, floating point add) to use for that variable type.

    An assembly language is different in that it is intended to directly control the CPU. When programming in assembly language it important to remember that assembly language does not keep a lot of information about the program as is done in a HLL with a compiler. The programmer must implement the correct type of operator (e.g., ADD, VADD) that they want to use. An assembler will happily apply a floating point addition (VADD) to two integer registers, or vice- versa. It is up to the programmer to remember the data types of the registers and use the correct operation.

    An assembly language is different from a HLL in other ways. In a HLL, each statement can correspond to many assembly statements, but each assembly language statement normally corresponds to a single CPU instruction. So, there is a correspondence between assembly language and control of the CPU. This means that each type of CPU needs its own assembly language, and the assembly language are different for each of different CPU.

    Assembly languages are designed for different purposes than HLL and thus are used differently. In assembly language an assembler takes assembly statements and simply converts them into the translated instructions are single CPU instructions.

    instructions for the CPU. The instruction must give the correct operation for the given operation types. This gives the programmer a lot of control over the CPU, but it also means that the code must be very detailed, and the user must have some concept of how the CPU works. It also means that the code can be cryptic, and programs can quickly get out of hand. Assembly language programming is really not a good option when a HLL solution can be made to work, but knowledge of assembly language is important for most programmers to understand programs in a HLL. One good rule of thumb is that a programmer should understand one level of abstraction lower than the tools and programs they are working with. A React programmer should understand JavaScript and HTML. An SQL programmer should know a HLL language with loops and if tests. And a programmer in a HLL should know assembly language. That way when problems occur, they are easier to understand and fix.


    1.4: What is Assembly Language? is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?