Write Your Own PRINT Function in Assembly | Beginner Tutorial | x86-64 Assembly Programming

Published: 01 November 2025
on channel: Mxy
3,451
162

Next video:    • How to Multiply & Divide in Assembly | Beg...  
Watch the course from the beginning:    • Learn Assembly For Beginners | Introductio...  
Previous Video in Course:    • String Length Function | Assembly Tutorial...  
Emulator Link: https://x64.halb.it

00:00 Step 1: Put string into RAM
00:50 Step 2: Understanding Syscall Write
04:00 Understanding Arguments in Assembly
06:27 Testing Program - Success!
09:45 Making it more Dynamic
12:30 Testing Again
13:00 Finding a Bug in strlen()
14:31 Caller Saved vs Callee Saved
16:00 Using Push/Pop with the Stack
CODE TO COPY:

/* Code Start */
_strlen:
mov rax, rdi

loop:
mov bl, [rax]
cmp bl, 0
je _strlen_exit
inc rcx
inc rax
jmp loop
_strlen_exit:
mov rax, rcx
ret
/* Code End */

Note: In the video, we add one line to clear RCX during initialization (not during the loop, or your strings will all evaluate to 0 length!)


On this page of the site you can watch the video online Write Your Own PRINT Function in Assembly | Beginner Tutorial | x86-64 Assembly Programming with a duration of online in good quality, which was uploaded by the user Mxy 01 November 2025, share the link with friends and acquaintances, this video has already been watched 3,451 times on youtube and it was liked by 162 viewers. Enjoy your viewing!