The 8086 family of processors is designed to operate on integer data; therefore, most assembler statements are integer operations. Even string elements (discussed in Chapter 5, “Defining and Using Complex Data Types”) are byte-sized integers to the assembler.
This chapter covers the concepts essential for using integer variables in assembly-language programs. The first section shows how to declare integer variables. The second section describes basic integer operations including moving, loading, and sign-extending integers, as well as calculating with integers. Finally, the last section describes how to do various operations with integers at the bit level, such as using bitwise logical instructions and shifting and rotating bits.
The complex data types introduced in the next chapter—arrays, strings, structures, unions, and records—use many of the integer operations illustrated in this chapter, since the components of complex data types are often integers. Floating-point operations require a different set of instructions and techniques. These are covered in Chapter 6, “Using Floating-Point and Binary Coded Decimal Numbers.”