If you are engaged in underlying windows development, you must understand the assembly language. In fact, the underlying layer of Windows is a machine code compiled using C language code, and then compiled into assembly language code by the debugger. We certainly cannot understand machine code. At this time, assembly language becomes a good medium.
Common stack-related commands
Push: Push a 32-bit operand into the stack. This operation causes ESP to be reduced by 4 (we think the top of the stack is a region with a small address), and the operand becomes the top of the stack.
Pop: In contrast to the push command, this command is the top operand of the stack, resulting in ESP plus 4.
Sub: subtraction command. The first parameter is the register where the subtrahend are located, and the second parameter is the memory where the subtrahend are located.
Add: Addition command. The principle is the same as above.
RET: return command, which is equivalent to jump back to the place where the function is called.
Call: Call a function.
Data transmission instructions
MoV: data movement. This is the simplest data transmission command. The first parameter book moves the data destination, and the second parameter is the data source.
XOR: exclusive or. This is a logic operator. However, commands such as XOR eax and eax are often used to replace mov eax and 0. The advantage is that they are faster and consume fewer bytes.
Lea: Get the address (the next operand) and put it in the previous memory.
STOs: String storage commands. To explain this command, you need to use a piece of code:
MoV ECx, 30 h
MoV eax, 0 ccccccch
Rep STOs dword pt Res: [EDI]
The function of the last sentence is to repeat the number of times entered in ECx and put the data in eax to the place specified by EDI.
Redirection and comparison commands
JMP: unconditional jump
JG: Jump when the value is greater than. Usually there is a comparison statement
JL: Jump when the value is smaller than. Usually there is a comparison statement
Jge: Jump when the value is greater than or equal to. Usually there is a comparison statement
CMP: comparison.