Implementing Functions in x86 Assembly

Scott Cosentino
5 min readDec 21, 2019

When we use functions in high-level languages, a lot of the details of what is happening is abstracted from us. When we work in assembly, we need to do more work to implement the structure properly. In general, there are five problems we need to be able to solve in order to create a function:

1. Call/Return: How do we get to the function, and how do we know where to return to once the function execution is completed?

2. Parameters: If the function requires parameters, where can they be stored so that the function can access them?

--

--