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.<br /><br />We cover:<br /> * The difference between unsigned (MUL) and signed (IMUL) multiplication<br /> * Two-operand vs three-operand IMUL forms<br /> * Multiplying immediate values vs global variables<br /> * Loading values into registers (mov) and performing fast multiplication<br /> * Basic addition with ADD and INC<br /> * Full working example that prints results so you can see it in action<br /> * Why you should respect the ABI and save callee-saved registers (R12-R15)<br /><br />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.<br /><br />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.<br /><br />Introduction to Integer Arithmetic 00:00:00<br />Recommended Book and Resources 00:00:39<br />Instruction Set Overview 00:01:17<br />Addition Instruction (ADD) 00:01:43<br />Unsigned vs Signed Multiplication 00:02:20<br />Signed Multiplication with IMUL 00:03:05<br />IMUL Three-Operand Form 00:03:40<br />IMUL Two-Operand Form 00:04:12<br />Squaring with IMUL 00:04:50<br />Setting Up the Sample Program 00:05:08<br />Data Section and Strings 00:06:13<br />Text Section and External Functions 00:06:58<br />Math Function Entry Point 00:08:01<br />Multiply Test Function Setup 00:08:42<br />Multiplying Immediate Values 00:09:48<br />Printing the Immediate Result 00:10:21<br />Running and Verifying Immediates 00:12:53<br />Multiplying Global Variables 00:13:49<br />Loading Globals into Registers 00:14:07<br />IMUL with Globals Demo 00:14:37<br />Addition with INC and ADD 00:15:36<br />Final Results and Verification 00:17:09<br />Wrap-Up and Closing 00:17:22<br />Outro and Subscribe Request 00:17:44<br /><br />Thanks for watching!<br /><br />Find us on other social media here:<br />- https://www.NeuralLantern.com/social<br /><br />Please help support us!<br /><br />- Subscribing + Sharing on Social Media<br />- Leaving a comment or suggestion<br />- Subscribing to our Blog<br />- Watching the main "pinned" video of this channel for offers and extras<br />
