DEV Community

Cover image for How to Say "Hello World" in x86 Assembly

How to Say "Hello World" in x86 Assembly

Sk on February 27, 2025

Because why not? Software is fun. I know this sounds insane; assembly for fun—but trust me, you feel alive. I’m lucky to be at a point where ...
Collapse
 
pxlmastrxd profile image
Caleb (pxlmastr)
#include <iostream>

int main() {
    std::cout << "To be honest, I'd rather stick to something normal :D";
    return 0;
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
sfundomhlungu profile image
Sk

#include <stdio.h>

int main() {
    printf("I agree! but this is normal 😂 :D\n");
    return 0;
}

Enter fullscreen mode Exit fullscreen mode
Collapse
 
komsenapati profile image
K Om Senapati
print("Weirdos")
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
pxlmastrxd profile image
Caleb (pxlmastr)
class Test
{
    public static void main(String[] args)
    {
        System.out.println("No, we are the same when we bond against java people");
    }
}
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
perisicnikola37 profile image
Nikola Perišić
print("Good post! 9.67 score on dev-to-rater.xyz")
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
sfundomhlungu profile image
Sk
import IO, only: [puts: 1]

puts("Uhmmm lol 😂😭") 
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
ezpieco profile image
Ezpie • Edited

let me join in

section .data
    msg db 'amateurs', 0

section .text
    global _start

_start:
    mov eax, 4
    mov ebx, 1
    mov ecx, msg
    mov edx, 8
    int 0x80

    mov eax, 1
    mov ebx, 0
    int 0x80
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ezek-iel profile image
Ezekiel • Edited

I'll just

gcc -s main.cpp
Enter fullscreen mode Exit fullscreen mode


`
that thanks.

Collapse
 
schemetastic profile image
Schemetastic (Rodrigo)
console.log("I think I'll stay with the good 'ol JS haha, but cool post 😉")
Enter fullscreen mode Exit fullscreen mode
Collapse
 
teminian profile image
Robert Teminian

Let me join. lol

Program HelloPascal;
begin
    writeln('Please don''t forget here''s Pascal.');
end.
Enter fullscreen mode Exit fullscreen mode
Collapse
 
skhmt profile image
Mike 🐈‍⬛ • Edited
Collapse
 
sfundomhlungu profile image
Sk

😭😭😂 solved!!

Collapse
 
benny00100 profile image
Benny Schuetz

Great to see assembly again. I used to code in assembly on the Amiga in the good old days.

Collapse
 
sfundomhlungu profile image
Sk

ahhh the old days 🏖️ I remember, I am lying I started this year 😂, I think I am a jr assembler? Loving it thou, so good to touch the metal

Collapse
 
benny00100 profile image
Benny Schuetz

Enjoy the ride. IMHO it will teach you a lot.

Collapse
 
0xw3ston profile image
Youssef El Idrissi

this is quite a cool blog post,
so I began to learn Computer Architecture & Organization and I found the assembly section to be the most interesting (because it's practical, and you could see the theory about registers etc in action).
But honestly I didn't find a right motive to learn it and be proficient in it, I'm learning it only for the curiosity at the moment but yk I still didn't find the right purpose.
So I ask you, could it possibly be useful in something like say... Malware development ? because code could be obfuscated etc on a very low level.
What do you think?

Collapse
 
chaymankala profile image
Chaitanya Mankala

Everyone who is commenting that they rather use high-level programming language for "Hello World", you should understand that even author is not recommending to use assembly in real life. We developed High Level languages to make our lives easier, everyone agrees on that. Its so sad that they cant appreciate assembly and not at all curious to understand how things work.

Future will be just like,
When someone writes a C program to print hello world, commentors like these will comment like "I would rather use chatGPT prompt, this is so stupid!"

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

People having entire conversations through code in comments lol. 🤣

Between, awesome post. 🔥

Collapse
 
chmoez profile image
Info Comment hidden by post author - thread only accessible via permalink
moez cherif

Protect your images in WordPress with adding watermarks automatically in just a few clicks with RMBG.PRO 🚀

youtu.be/Xqhtht95P-c

WordPress #Watermark #WordPressPlugin #ImageProtection #WebDesign #Photography #BloggingTips #WordPressTutorial

Collapse
 
cc_f9f91ece754f4e626078c2 profile image
cc44599

1

Collapse
 
armando_ota_c7226077d1236 profile image
Armando Ota

Noice ... Brings back memories of writing asm code for z-80 ;)

Collapse
 
cng_tytnhhxydngv profile image
CÔNG TY TNHH XÂY DỰNG VÀ THƯƠNG MẠI VÂN QUÂN

Thật sự rất nhiều bài viết hữu ích trên danchoi.com, đừng ngần ngại ghé qua!

Some comments have been hidden by the post's author - find out more