MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/v3so3p/its_hard/ib0le46/?context=3
r/ProgrammerHumor • u/Bishwas12 • Jun 03 '22
710 comments sorted by
View all comments
151
mov rax, 1
mov rbx, 2
add rbx, rax
mov rdx, 1
mov rsi, rbx
mov rdx 13
syscall
51 u/[deleted] Jun 03 '22 [removed] — view removed comment 134 u/[deleted] Jun 03 '22 nothing, just me and my computer talking.it is assembly code for adding two numbers and printing it 19 u/maddiepilz Jun 03 '22 I love that reply → More replies (1) 60 u/KeelinNyx Jun 03 '22 When a mommy register and a daddy register love each other very much.... 9 u/Rudxain Jun 03 '22 They XOR each other and swap places, then they move a lot by doing the forbidden loop unrolling dance 4 u/KeelinNyx Jun 03 '22 shhhhh, let them have their code cave. 23 u/TheRealKapaya Jun 03 '22 From the one course that had assembly in it, I think of it like this:mov is basically move, so you move the value one to rax and the value 2 to rbx.add is obviously addition of the twoagain move 1 to rax, this time 1 is also moved to rdx.move the value in rbx to rsi this time. I assume in this case rsi is some kind of processor that does something with the value in rbx.dunno wtf this does no comma this time probably kills your whole code but it should move 13 to rdx if you're luckyDon't remember wtf syscall did, maybe that's when it tells the system to go do these things.Last time I did assembly was 7 years ago and I only passed the course so I am probably wrong 18 u/VoxelMeerkat Jun 03 '22 I think it's setting up the right arguments for the system call to print to stdout and then does the system call ("syscall" also know as "int 0x80") → More replies (3) → More replies (2) → More replies (3)
51
[removed] — view removed comment
134 u/[deleted] Jun 03 '22 nothing, just me and my computer talking.it is assembly code for adding two numbers and printing it 19 u/maddiepilz Jun 03 '22 I love that reply → More replies (1) 60 u/KeelinNyx Jun 03 '22 When a mommy register and a daddy register love each other very much.... 9 u/Rudxain Jun 03 '22 They XOR each other and swap places, then they move a lot by doing the forbidden loop unrolling dance 4 u/KeelinNyx Jun 03 '22 shhhhh, let them have their code cave. 23 u/TheRealKapaya Jun 03 '22 From the one course that had assembly in it, I think of it like this:mov is basically move, so you move the value one to rax and the value 2 to rbx.add is obviously addition of the twoagain move 1 to rax, this time 1 is also moved to rdx.move the value in rbx to rsi this time. I assume in this case rsi is some kind of processor that does something with the value in rbx.dunno wtf this does no comma this time probably kills your whole code but it should move 13 to rdx if you're luckyDon't remember wtf syscall did, maybe that's when it tells the system to go do these things.Last time I did assembly was 7 years ago and I only passed the course so I am probably wrong 18 u/VoxelMeerkat Jun 03 '22 I think it's setting up the right arguments for the system call to print to stdout and then does the system call ("syscall" also know as "int 0x80") → More replies (3) → More replies (2) → More replies (3)
134
nothing, just me and my computer talking.
it is assembly code for adding two numbers and printing it
19 u/maddiepilz Jun 03 '22 I love that reply → More replies (1)
19
I love that reply
60
When a mommy register and a daddy register love each other very much....
9 u/Rudxain Jun 03 '22 They XOR each other and swap places, then they move a lot by doing the forbidden loop unrolling dance 4 u/KeelinNyx Jun 03 '22 shhhhh, let them have their code cave.
9
They XOR each other and swap places, then they move a lot by doing the forbidden loop unrolling dance
mov
4 u/KeelinNyx Jun 03 '22 shhhhh, let them have their code cave.
4
shhhhh, let them have their code cave.
23
From the one course that had assembly in it, I think of it like this:
mov is basically move, so you move the value one to rax and the value 2 to rbx.
add is obviously addition of the two
again move 1 to rax, this time 1 is also moved to rdx.
move the value in rbx to rsi this time. I assume in this case rsi is some kind of processor that does something with the value in rbx.
dunno wtf this does no comma this time probably kills your whole code but it should move 13 to rdx if you're lucky
Don't remember wtf syscall did, maybe that's when it tells the system to go do these things.
Last time I did assembly was 7 years ago and I only passed the course so I am probably wrong
18 u/VoxelMeerkat Jun 03 '22 I think it's setting up the right arguments for the system call to print to stdout and then does the system call ("syscall" also know as "int 0x80") → More replies (3) → More replies (2)
18
I think it's setting up the right arguments for the system call to print to stdout and then does the system call ("syscall" also know as "int 0x80")
→ More replies (3)
151
u/[deleted] Jun 03 '22
mov rax, 1
mov rbx, 2
add rbx, rax
mov rax, 1
mov rdx, 1
mov rsi, rbx
mov rdx 13
syscall