Skip to main content
\(\newcommand{\doubler}[1]{2#1} \newcommand{\binary}{\texttt} \newcommand{\hex}{\texttt} \newcommand{\octal}{\texttt} \newcommand{\prog}{\texttt} \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Chapter9Programming in Assembly Language

Creating a program in assembly language is essentially the same as creating one in a high-level compiled language like C, C++, Java, FORTRAN, etc. We will begin the chapter by looking in detail at the steps involved in creating a C program. Then we will look at which of these steps apply to assembly language programming.

Before starting this chapter, I recommend that you reread Section 1.4 to make sure your development environment is complete.

Also note that the ARM architecture includes two instruction sets—ARM and Thumb. Raspbian provides only partial support, at best, for the Thumb instruction set, so we will only use the ARM instruction set in this book.

While reading this chapter, you should also consult the info resources available in most GNU/Linux installations for both the make and the as programs. Appendix C provides a general tutorial for writing Makefiles, but you need to get the details from info, is especially important for learning about as's assembler directives.