Skip to main content
Engineering LibreTexts

1.5: Format for using this textbook

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

    The rest of this textbook is broken down as follows.

    Chapter 2 gives an overview of binary representation. Knowing binary numbering systems, including binary whole number, character data, and 2’s complement (integer) numbers, is an essential skill in being able to data in a CPU. Understanding how to do arithmetic in 2’s complement is vital to being able to read and understand the arithmetic that is going on inside a computer. Being able to do simple multiplication and subtraction using shift operations are skills every programmer should understand. Finally knowing and using binary and shift operations are at the heart of every CPU and many algorithms and used frequently in this textbook. These are the topics of Chapter 2, and a basic knowledge of this material is essential to understanding the rest of the textbook.

    Chapter 3 starts the journey of learning ARM Assembly. This chapter starts by creating a HelloWorld program. The assembly language program is written, compiled and linked (using the make command), and run from the shell prompt. How to prompt for and print strings and integers is covered. Finally, an introduction to the gdb debugger’s text user interface (gdbtui) is given to show how to visualize and debug running programs.

    Chapter 4 builds on the ARM Assembly operations by restricting the operation to a 3-Address format and showing how they would be executed on a hypothetical 3-Address Load/Store CPU. The operations are all valid ARM Assembly operations, but they are purposefully restricted to provide a simplified instruction set that can be built on in Chapter 5.

    Chapter 5 builds on the 3-Address CPU to create the MSCPU, which allows the ARM Flexible Operand or Operand2 to be used in the instructions, as well as some other instructions such as the Multiply and Accumulation (MLA) instruction.

    Chapter 6 introduces the concept of machine code. The chapter covers how to translates the ARM Assembly instructions from Chapter 3 into machine code using the various machine code formats needed by the 3-Address CPU. It will also cover how to interpret machine code and how to translate machine code back into 3-Address CPU assembly instructions.

    Chapter 7 covers functions and program control flow using the PC. Branching to a function by changing the pc to the address of the first instruction is discusses and illustrated. The problem of returning from a function is presented, and the return of the function using the lr is shown. Finally the register conventions for ARM are given.

    Chapter 8 introduces procedural block structured programming, which is the type of programming most readers are familiar with though they probably do non know it. This style of programming treats blocks of code as statements, and implements a standard structure for branching and looping blocks. How to properly structure a program using procedural block structure is covered in detail, and the ways to avoid spaghetti code, or unstructured code, is shown.

    Chapter 9 covers recursion, and how to convert from a HLL to assembly for recursion is shown. By implementing recursion in ARM Assembly the concept and purpose of the stack is made more transparent and more clear.

    Chapter 10 is about a type of multi-valued variable called an array. How arrays are implement and accessed in ARM Assembly is discussed and illustrated. Also covered is the concept of multi-valued variables and dereference operators, and the relationship between a value and a reference is explained.

    What you will learn (Chapter 2)

    In this chapter you will learn:

    1. what binary numbers are and how they relate to computer hardware
    2. to translate to/from binary, decimal, and hexadecimal
    3. binary character data representation in ASCII
    4. binary 2's complement format, which is the format used for integers in most computers
    5. arithmetic operations for integer numbers
    6. binary logic operations
    7. the effect of context on data values in a computer

    1.5: Format for using this textbook is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?