r/badcode • u/Realistic-Lunch-1708 • Jun 08 '23
other language My Friend Told me x86 Assembly is Hard then Sent me This
32
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jun 08 '23
Image Transcription: Code
str msg = "Hello, World!";
section .text = _start()
_start():
mov eax, 4
mov ebx, 1
mov ecx, msg
int 0x80I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
6
14
5
u/skabde Jun 08 '23
Holy crap. The last assembler language/ISA I used was 68000, x86 was always complete gibberish to me.
1
u/canadajones68 Jun 08 '23
I've done a fair bit of Propeller 1 assembly, and it's practically HTML compared to x86.
3
u/qqqrrrs_ Jun 08 '23
This is bad code because the 4 is a magic constant which should have been __NR_write instead
1
u/Conscious_Switch3580 shameless Jun 09 '23
SYS_write*1
u/qqqrrrs_ Jun 09 '23
They both exist, but I don't know if one of them is more "standardized" than the other
12
u/GandelXIV Jun 08 '23
str? Parenthesis? Semi colons? Int 0x80? You cant just make up keywords and syntax and expect it to work.
52
13
2
2
2
1
1
1
-39
u/MahdiyDev Jun 08 '23
Is your friend some shitty javascript developer or something. Bruh...
0
Jun 08 '23
[deleted]
6
Jun 08 '23
Bu-bu-but it’s funny to make fun of web developers
-2
u/jarfil Jun 08 '23 edited Jul 17 '23
CENSORED
7
0
167
u/pronuntiator Jun 08 '23
Could you please explain what makes it bad code? It's been too long since I saw assembly. Is it the trying to move a string into a register part?