© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
J. BartlettLearn to Program with Assemblyhttps://doi.org/10.1007/978-1-4842-7437-8_4

4. Registers and Simple Arithmetic

Jonathan Bartlett1  
(1)
Tulsa, OK, USA
 

In the last chapter, we learned the basic structure of an assembly language program and how to assemble, link, and run it and display the exit status code. This chapter will focus on getting to know the register set of the x86-64 ISA as well as learning a few new instructions to make the code a little more interesting. We will start by looking at a few arithmetic instructions so we can expand beyond just moving data around.

4.1 Simple Arithmetic Instructions

So far, we have learned two instructions:

Get Learn to Program with Assembly: Foundational Learning for New Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.