this post was submitted on 24 Jun 2023
41 points (100.0% liked)

Programming

17509 readers
8 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

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.

top 3 comments
sorted by: hot top controversial new old
[–] RandomDevOpsDude 11 points 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 5 points 1 year ago (1 children)

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.

[–] learnbyexample 3 points 1 year ago

I'm just sharing the article here.

You might be able to reach the author via https://github.com/gaultier/blog/issues or https://www.linkedin.com/in/philippegaultier/