x86-64 Assembly: Signed Integer Multiplication and Addition with IMUL & ADD (YASM on Ubuntu Linux)
N
Neural Lantern
14 Views • Nov 30, 2025
Description
Want to actually understand how signed integer multiplication works at the CPU level? In this straight-to-the-point x86-64 assembly tutorial we dive into the IMUL instruction - the proper way to multiply signed integers in YASM/NASM on Linux.
We cover:
* The difference between unsigned (MUL) and signed (IMUL) multiplication
* Two-operand vs three-operand IMUL forms
* Multiplying immediate values vs global variables
* Loading values into registers (mov) and performing fast multiplication
* Basic addition with ADD and INC
* Full working example that prints results so you can see it in action
* Why you should respect the ABI and save callee-saved registers (R12-R15)
Everything is built with YASM on Ubuntu, linked with a tiny C driver, and run instantly. No fluff, just real assembly code you can copy and run right now.
Code on screen, calculator verification, and clear explanation of every line. Perfect if you're learning low-level programming, reverse engineering, or just want to know what really happens when you write a = b * c; in C.
Introduction to Integer Arithmetic 00:00:00
Recommended Book and Resources 00:00:39
Instruction Set Overview 00:01:17
Addition Instruction (ADD) 00:01:43
Unsigned vs Signed Multiplication 00:02:20
Signed Multiplication with IMUL 00:03:05
IMUL Three-Operand Form 00:03:40
IMUL Two-Operand Form 00:04:12
Squaring with IMUL 00:04:50
Setting Up the Sample Program 00:05:08
Data Section and Strings 00:06:13
Text Section and External Functions 00:06:58
Math Function Entry Point 00:08:01
Multiply Test Function Setup 00:08:42
Multiplying Immediate Values 00:09:48
Printing the Immediate Result 00:10:21
Running and Verifying Immediates 00:12:53
Multiplying Global Variables 00:13:49
Loading Globals into Registers 00:14:07
IMUL with Globals Demo 00:14:37
Addition with INC and ADD 00:15:36
Final Results and Verification 00:17:09
Wrap-Up and Closing 00:17:22
Outro and Subscribe Request 00:17:44
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
Please help support us!
- Subscribing + Sharing on Social Media
- Leaving a comment or suggestion
- Subscribing to our Blog
- Watching the main "pinned" video of this channel for offers and extras
We cover:
* The difference between unsigned (MUL) and signed (IMUL) multiplication
* Two-operand vs three-operand IMUL forms
* Multiplying immediate values vs global variables
* Loading values into registers (mov) and performing fast multiplication
* Basic addition with ADD and INC
* Full working example that prints results so you can see it in action
* Why you should respect the ABI and save callee-saved registers (R12-R15)
Everything is built with YASM on Ubuntu, linked with a tiny C driver, and run instantly. No fluff, just real assembly code you can copy and run right now.
Code on screen, calculator verification, and clear explanation of every line. Perfect if you're learning low-level programming, reverse engineering, or just want to know what really happens when you write a = b * c; in C.
Introduction to Integer Arithmetic 00:00:00
Recommended Book and Resources 00:00:39
Instruction Set Overview 00:01:17
Addition Instruction (ADD) 00:01:43
Unsigned vs Signed Multiplication 00:02:20
Signed Multiplication with IMUL 00:03:05
IMUL Three-Operand Form 00:03:40
IMUL Two-Operand Form 00:04:12
Squaring with IMUL 00:04:50
Setting Up the Sample Program 00:05:08
Data Section and Strings 00:06:13
Text Section and External Functions 00:06:58
Math Function Entry Point 00:08:01
Multiply Test Function Setup 00:08:42
Multiplying Immediate Values 00:09:48
Printing the Immediate Result 00:10:21
Running and Verifying Immediates 00:12:53
Multiplying Global Variables 00:13:49
Loading Globals into Registers 00:14:07
IMUL with Globals Demo 00:14:37
Addition with INC and ADD 00:15:36
Final Results and Verification 00:17:09
Wrap-Up and Closing 00:17:22
Outro and Subscribe Request 00:17:44
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
Please help support us!
- Subscribing + Sharing on Social Media
- Leaving a comment or suggestion
- Subscribing to our Blog
- Watching the main "pinned" video of this channel for offers and extras
Keywords & Tags
#x86-64 assembly
#imul instruction
#signed multiplication assembly
#yasm tutorial
#nasm imul
#x86-64 multiplication
#assembly language programming
#low level programming
#systems programming
#ubuntu assembly
#intel imul
#assembly arithmetic
#x86_64 tutorial
#reverse engineering basics
#cpu registers assembly
More from User
20:46
Graph Basics in Data Structures: Nodes, Edges, and Representations
Neural Lantern
26:46
4 Graph Types: Undirected vs Directed, Weighted vs Unweighted
Neural Lantern
25:33
AVL Trees: Adding Linear Data and Performing Rotations
Neural Lantern
36:36
AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step
Neural Lantern
16:03
How to Perform AVL Tree Rotations - Step By Step Example
Neural Lantern
25:14
AVL Tree Rotations Tutorial: Fixing Imbalance After Adding a Node
Neural Lantern
Related Videos
38:46
x86-64 Assembly: Integer Data Movement, Pointers, and Dereferencing Explained (YASM on Ubuntu)
Neural Lantern
28:31
x86-64 Assembly While Loops Explained Step by Step in YASM - From Concept to Working Program
Neural Lantern
26:00
Mastering System Services in x86-64 Assembly Programming
Neural Lantern
41:43
x86-64 Assembly: Floating Point Registers Basics with YASM (MOVSD, MULSD, CVTSI2SD)
Neural Lantern
32:58
x86-64 Assembly Pointers & Dereferencing Explained - Hybrid C++/YASM Example
Neural Lantern
50:14
Mastering x86-64 YASM Assembly: Functions Made Simple
Neural Lantern