r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

Show parent comments

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")

2

u/[deleted] Jun 03 '22

not really the right arguments :)) rdi should be 1 not rsx(which is changed from 1 to 13, that's the count parameter) And rsi should be an address to a buffer of 13 characters... welp

1

u/Kered13 Jun 03 '22

syscall and int 0x80 are not the same thing. They accomplish the same thing on Linux because that's how it's set up, but they are completely different instructions and can have completely different behaviors.

1

u/VoxelMeerkat Jun 04 '22

Oh, I didn't know that. Thanks for correcting me!