1179
you are viewing a single comment's thread
view the rest of the comments
[-] pivot_root@lemmy.world 6 points 13 hours ago

That assembly is for a DOS application. It would be more verbose for a modern Linux or Win32 application and probably require a linker script.

But python turns that cute little line up top, into that mess at the bottom.

Technically, not quite. Python is interpreted, so it's more like "call the print function with this string parameter" gets fed into another program, which calls it's own functions to make it happen.

[-] ericbomb@lemmy.world 1 points 14 minutes ago

Yeah over simplifying it a bit, and that's funny that the stupid thing I found wasn't even stupid enough.

But was mostly trying to impart that we should be happy for modern languages, because for every line you write in a modern language, it'll do a dozen things on the back end for you that in assembly you'd need to do by hand.

[-] UpperBroccoli@lemmy.blahaj.zone 1 points 4 hours ago

This is what gcc 13.2.0 makes of it in Linux:

So basically just loading the string and calling 'printf' from the libc.

this post was submitted on 17 Oct 2024
1179 points (98.9% liked)

RetroGaming

19341 readers
1366 users here now

Vintage gaming community.

Rules:

  1. Be kind.
  2. No spam or soliciting for money.
  3. No racism or other bigotry allowed.
  4. Obviously nothing illegal.

If you see these please report them.

founded 1 year ago
MODERATORS