this post was submitted on 05 Dec 2023
794 points (95.1% liked)

Programmer Humor

19551 readers
543 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] CanadaPlus@lemmy.sdf.org 1 points 11 months ago (1 children)

Is there a tutorial you could recommend? I'm actually pretty curious how exactly you would go about that now.

[โ€“] rottingleaf@lemmy.zip 2 points 11 months ago* (last edited 11 months ago)

Sorry, I don't remember what I used then as a tutorial, possibly nothing, and I don't write assembly often, it was just an opinion based on the experience from the beginning of my comment. That said:

You have call and return, so you can use procedures with return. You have compare and conditional jump instructions. And you have timers and interrupts for scheduling. That allows for basic structure.

You split your program functionally into many files (say, one per procedure) and include those. That allows for basic complexity management.

To use OS syscalls you need to look for the relevant OS ABI reference, but it's not hard.

So all the usual. Similar to the dumber way of using C.

In general writing (EDIT: whole programs, it's used all the time in codecs and other DSP, at the very least) in assembly languages is unpopular not because it's hard, but because it's very slow.