Adding two numbers in macOS x86-64 Assembly - Part 2
byThis is the second part as continuation of series “My first x86-64 assembly in macOS”. Please read first part to view assembly language programming from the perspective of total beginner. I thought simple addition of two numbers in assembly could be the next simple step in progress to learn assembly language programming, covering declaration of variable(kinda), accessing them, adding them and printing them. Hoping to give some more insights on assembly language programming adventure. This post follows same spirit of exploring the findings and observation through perspective of total beginner. If any information provided seems wrong please email me with explanation so I could understand and rectify. Most of the concepts we did explored in first part of the series but I will try to do very short brief here too.
I am using Intel based Mac running Catalina. In future when arm based Mac comes out, then this series may need to be interpreted separately. I am using AT&T syntax throughout the series.
Important Note:
Following assembly code may not be optimised. This assembly code to calculate the sum of numbers is for simple learning of following concepts:- Declare and Initialise variables in assembly.
- Access variables in assembly.
- Perform addition on variables in assembly.
- Print the sum of variables in assembly.