"Copyright Notice: respect for the original, reproduced please retain the source: blog.csdn.net/shallnet, the article only for learning Exchange, do not use for commercial purposes"
similar to other high-level languages, writing assembly language, there must be a development environment, then you need the appropriate tools. Assemble assembly language at least the following tools should be available: assembler, linker, debugger. below to see how they are used in the assembly language development environment.
assembler is used to convert the assembly language source code to the processor instruction code. The assembler chosen must be able to generate the processor family script for the system in which it resides. Assembly language Source code program has 3 parts: opcode mnemonic, data section, command. But each assembler uses a different format for each part, so programming with one assembler can be completely different from using another assembler, the biggest difference between the assembler is the assembly command, and the general choice is simply to create the assembler for the target environment. Some common assemblers on the Intel IA-32 platform are MASM, NASM, gas (GNU assembler), and HLA.
assembler does not compile and link one go like a high-level language, it requires a manual operation to connect the Assembly object code with other libraries.
The debugger must understand the set of scripts for the hardware platform and understand how the operating system handles registers and memory.
The GNU Assembler (gas) is the most popular assembler in the UNIX environment, and it is capable of compiling scripts for several different hardware platforms. This series of articles is written for gas in all assembly examples. Most Linux distributions already contain gas assemblers, which are included in the GNU Binutils package along with other development software. The following is the author's system-related information and find the installed Binutils package.
The gun assembler is a command-line-oriented program, so the runtime should use the correct command-line arguments. Its command-line executable is the "as" command. Use it to view its help on the command line. The GNU linker is the command "LD", which is used to link the target code file to an executable file or library file. compiling an assembly language program into an executable file is roughly as follows:
As-o TEST.O test.sld-o Test TEST.O
The GNU objdump program is another tool that is very useful to programmers in the Binutils package. The programmer can use this command to view the script generated by the compiler in the target file, not only to display the assembly code, but also to display the generated you are the script code.
In this series of articles, we use the Linux environment for development, so the tools used are naturally the GNU tools, and they are free.
Linux Platform x86 compilation (III): Related development tools