Compilation function

What is the function

  • Function is a series set of instructions , in order to complete a special function reuse.

    For example: the value stored in the register.

Here Insert Picture Description

How to call a function

  • JMP instructions to perform functions by
  • With the CALL command to execute the function
    in most cases, we will use this instruction to call the function call, because even if the call is over, the program will retn back, then execute instruction is not executed, although jmp instruction can jump back, but with it is better to call instruction convenient.

What are the parameters and return values

We direct writing a parameter to analyze

Function: to get any two integers
Here Insert Picture Description

Here, we usually use the EAX register to store the return value , use registers to pass parameters , but this is not certain. Here it comes to branch instructions and instructions to modify the value of EIP, is not very understanding can click here , there are detailed reports, compiled this thing I feel more abstract, only more training, more than a place to run the fuzzy return next several observations case, it made complete fix.

Published 25 original articles · won praise 29 · views 4194

Guess you like

Origin blog.csdn.net/qq_43573676/article/details/104355838