Assembler--to the procedure and the compilation process

Source: Internet
Author: User

Assemble the source program structure assembly instructions: There is a corresponding machine code instructions, can be compiled into machine instructions, and ultimately executed by the CPU. Pseudo-directive: instructions executed by the compiler, no corresponding machine code, compiler is related to the compiler according to pseudo-instructions. Segment: A assembler is made up of multiple segments. Used for storing code, data, or as a stack space, respectively. Description: A meaningful assembly source program must contain at least one segment to hold the assembly instruction code.   Compilation programming process edit, compile, connect, execute   Compile process: Enter DOS, run the compiler Masm.exe enter the source file name to compile to determine the target filename (. obj) resulting list file (. lst) produces a cross-reference file (. CRF) Compile end, output compilation result. The function of   connection will connect the target file of multiple source program;  program calls a subroutine in a library file, connects the library file and the target file, and compiles the generated target file, some content is not directly used to generate the executable file, it needs to be processed by the connection as the final executable information.   Description: Command.com is a DOS command interpreter program, which is the shell of a DOS system, and the load operation is performed by debug when running with the Debug tracker. Note: DOS is a single-tasking system.   Program loading process: disk access to the. exe program;  find a sufficient amount of free memory area, the offset address of the starting address of the memory area is 0;  in the memory area of the first 256 bytes to create a program segment prefix psp;  Start loading the program from 256 bytes in the memory area;  the segment address of the memory area into DS, initialize other related registers, and set Cs:ip to point to the program entry.   DUBUG Tracking during program execution: Debug can load the program into memory, set CS:IP to point to the program's entry, but debug does not abandon the control of the CPU, so that we can use the relevant command of debug to step into the program, View the execution results of each instruction directive.   Related commands: Debug myfile: Loader r: View register settings u: View instruction sequence T: Step into P: Execute a set of instructions   Description: After the debug loader, CX holds the program length, DS and ES, CS and SS values are the same, ip=0000h.   Nonsense: This part is involved in a part of the operating system and the knowledge of compiling principles, but the book does not explain, Cao Tan small dedication will not (but will soon be). The personal sense of learning assembly can make me more in-depth understanding of the C + +, and can more easily learn the principles of microcomputer, compiling principles, operating systems and other related knowledge.

Assembler-Procedures and compilation procedures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.