1354
you are viewing a single comment's thread
view the rest of the comments
[-] ayyy@sh.itjust.works 68 points 4 days ago

The game Roller Coaster Tycoon was famously hand written in raw CPU instructions (called assembly language). It’s only one step removed from writing literal ones and zeros. Normally computers are programmed using a human-friendly language which is then “compiled” into CPU instructions so that the humans don’t have to deal with the tedium and complication of writing CPU instructions.

[-] IMNOTCRAZYINSTITUTION@lemmy.world 19 points 4 days ago
[-] ericbomb@lemmy.world 9 points 4 days ago

To send the point home even more, this is how in python you make a line of text display:

print("Hello World")

This is the same thing, in assembly (According to a blog I found. I can't read this. I am not build better.)

  org  0x100        ; .com files always start 256 bytes into the segment

    ; int 21h is going to want...

    mov  dx, msg      ; the address of or message in dx
    mov  ah, 9        ; ah=9 - "print string" sub-function
    int  0x21         ; call dos services

    mov  ah, 0x4c     ; "terminate program" sub-function
    int  0x21         ; call dos services

    msg  db 'Hello, World!', 0x0d, 0x0a, '$'   ; $-terminated message

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

I like python. Python is cute. Anyone can read python.

[-] pivot_root@lemmy.world 6 points 4 days 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.

[-] UpperBroccoli@lemmy.blahaj.zone 2 points 4 days 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.

[-] ericbomb@lemmy.world 1 points 3 days 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.

load more comments (1 replies)
load more comments (6 replies)
this post was submitted on 17 Oct 2024
1354 points (98.9% liked)

RetroGaming

19386 readers
899 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