We have already done bit operations in Chapter 9 on integer arithmetic: shift arithmetic sar and sal are bit operations, shifting bits right or left. Also, the and instruction for aligning the stack covered in the previous chapter is a bit operation.
Basics
In the following example program, we are building a custom C function called printb to print a string of bits. For convenience, it separates the string of 64 bits into 8 bytes, with 8 bits each. As an exercise, after you finish this chapter, take a look at the C code, and you should be able to write an assembler program to build a string ...