Most people think assembly is only to be used to write toy programs for learning purposes, or to write a highly optimized version of a specific function inside a codebase written in a high-level language.

Well, what if we wrote a whole program in assembly that opens a GUI window? It will be the hello world of the GUI world, but that still counts.

  • RandomDevOpsDude
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 year ago

    The original Roller Coaster Tycoon is famously written in assembly.

    Sawyer wrote 99% of the code for RollerCoaster Tycoon in assembly code for the Microsoft Macro Assembler, with the remaining one percent written in C.

    wikipedia

    This always blew my mind, especially when struggling around with things like cmu bomblab back in the day.

    I haven’t thought about assembly in a long time, and not sure if I want to ;P

    Looks like a nice detailed walkthrough though!

  • mrkite
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    I think this is a good idea, at the very least to teach how x11 works, since a lot of that gets buried in libraries. I just have two concerns.

    One: I’m a little confused to why you decided to use the stack as temporary storage in the stdout pointer example as opposed to using a global .data segment. Using the stack for locals, the stack for function arguments, and basic pointers is a lot to cover all at once.

    and two: you should really give a higher level overview of x11 first. Otherwise you’re just randomly opening a socket and stuffing data into it without explaining why.