Skip to main content
Engineering LibreTexts

2.1: What is Assembly Language

  • Page ID
  • \( \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}}\)

    Assembly language is a very low level, human readable and programmable, language where each assembly language instruction corresponds to a computers machine code instruction. Assembly language programs translate directly into machine code instructions, with each assembly instruction translating into a single machine code instruction1.

    After having chosen a basic address format for the architecture, the format of the assembly language, called an Instruction Set Architecture (ISA), is defined. The next step is to design the entire assembly language that will be translated and run on the CPU.

    The following are the steps in design of the CPU.

    1. First, the assembly language is designed that can be used to write programs for this CPU. This language is tested by implementing simple programs in the assembly language.
    2. A machine code representation for the assembly language will be written. The CPU only has the ability to interpret information that is binary data, so the assembly language needs to be translated into binary data that will be understood by the CPU.
    3. The CPU is then designed to execute the machine code instructions.

    This process of designing the language, creating the machine code for the language, and implementing the CPU is normally iterative, but the only final product of these steps will be included in this monograph.

    The first step, the creation of the assembly language, is the topic of this chapter.

    To create an assembly language there are three major constraints to the language that must be defined.

    1. The definition of data that will be dealt with in this CPU need to be defined. In higher level languages this would be types, like integer, float, or string. In a CPU, types do not exist. Instead the CPU is concerned with issues such as the size of a word in the computer, and how memory addresses will be used to retrieve data.
    2. A set of assembler directives to control the assembler program as it runs. Directives to define issues such as the type of memory being accessed (text or data), labels to specify addresses in the program, how to allocate and store program data, and how comments are defined.
    3. A complete set of assembler instructions must be defined.

    The next section of this chapter will give some caveats to programmers coming from a higher level language about issues they should consider when programming in assembly language. The 3 sections after that will define the data used in the assembler, the assembler directives, and the assembler instructions.

    1 Normally this one-to-one correspondence between assembly language instructions and machine code instructions is removed. Assembly languages will define pseudo instructions that are translated into multiple machine code instructions. These pseudo instructions are designed to make it easier to write programs in the assembly language. This monograph is designed to show the reader how the CPU works, and so every assembly language instruction will correspond to a single machine language instruction.

    This page titled 2.1: What is Assembly Language is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Charles W. Kann III via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?