Just as I asked in my question,
what is a pass in the Assembly code compiling process , thanks to explain
In order to generate an object file, the assembler needs to do two things translate each instruction mnemonic into instruction bytes, e.g. add eax, ds:[eax] to 0x0000.
Some of these are easy to do, since all the information is contained in the instruction. However, some instructions have references to elements outside the instruction, such as:
If the jump target or memory location have already been seen, there's no problem. However, assembly doesn't limit you to accessing locations that have been seen (such as C, which only allows you to use identifiers that were defined at an earlier point in the file), so there may be cases where an identifier isn't known yet. For instance:
cmp eax, 0
jz skip_this
add eax, edx
skip_this:
mov ecx, eax
In this example, skip_this isn't known when the jz is encountered, so the assembler doesn't know what address to put there.
In order to build the object file, the assembler processes the assembly file one line at a time. It translates what it can, and keeps track of what it still doesn't know yet. By the end of this stage, all of the identifiers have been encountered.
When the assembler finishes this stage, it processes the assembly file again and fills in the blanks.
Now, to answer your question, each of this stages of processing the entire source file from beginning to end is called a pass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With