Using Macros and Passing Arguments on the Stack
摘要
So far, we’ve looked at assembly language programs that call the Linux kernel directly, and assembly language programs that call glibc. We’re now going to look at assembly language methods that are callable from C or C++ programs. In Chapter 3 , you wrote an assembly language program that has a main. In this chapter, we don’t have the same program written in C and in assembly language. Instead, we have a C program that invokes the printEnv function. The printEnv method is in its own module environment.asm. It does not have a main. It also illustrates the nasm/yasm macro capability. Using the macro capability makes your assembly language programs start to look like a high-level language.