This chapter explains how to write functions in assembly language. Assembly language is a low-level programming language that is specific to a particular computer architecture. So, unlike programs written in high-level languages, programs written in assembly language cannot be easily ported to other hardware architectures. Assembly language programs are converted into object code by a program called an assembler. In practice, assembly language is used only rarely and most embedded software is written in a high-level language, such as C. Assembly language is only used when the programmer needs precise control over the machine architecture and needs to access specific registers or when execution time is an important consideration. Such occasions typically occur during the following:
Initializing the system
Servicing I/O devices
Handling interrupts
Assembly language programmers need a model of the computer architecture to enable them to write programs. This so called programmers' model...