Arithmetic and Logic Operations
Learn to perform basic arithmetic (ADD, SUB, MUL, DIV) and logical operations (AND, OR, XOR, NOT) on data in registers and memory.
Intro to Assembly Ops
Welcome to the world of x86 Assembly's core operations! Today, we'll learn how CPUs perform basic math and logic.
These instructions are fundamental. They allow your programs to calculate values, make decisions, and manipulate data at the lowest level.
Addition: The ADD Instruction
The ADD instruction is used to add two numbers. It takes two operands: a destination and a source.
- Syntax:
ADD destination, source - The
sourcevalue is added to thedestinationvalue. - The result is stored back in the
destinationoperand. - Operands can be registers, memory locations, or immediate values (constants).
For example, ADD EAX, EBX adds the value in EBX to EAX, storing the sum in EAX.
All lessons in this course
- Data Movement Instructions (MOV, PUSH, POP)
- Arithmetic and Logic Operations
- Conditional Jumps and Loops
- Bitwise and Shift Instructions