• CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    11 months ago

    I wouldn’t be able to write Rollercoaster Tycoon in assembly because keeping track of all that code in assembly files must be hell, but people pretending like you need to be some kind of wizard to write assembly code are exaggerating.

    Well, they’ve got a point for the bigger machine codes. Just the barebones specification for x86 is a doorstopper IIRC.

    From what I’ve heard, writing big stuff in assembly comes down to play-acting the compiler yourself on paper, essentially.

    • Skull giver@popplesburger.hilciferous.nl
      link
      fedilink
      English
      arrow-up
      4
      ·
      11 months ago

      From what I’ve heard, writing big stuff in assembly comes down to play-acting the compiler yourself on paper, essentially.

      I think that’s true for just about any programming languages, though the program you’re “compiling” is a human understanding of what you’re trying to accomplish. Things like val bar = foo.let { it.widget?.frub() ?: FrubFactory::defaultFrub(it) } don’t come naturally to the human mind, you’re already working through the logic required before you start typing.

      As for the x86 instruction count: you don’t need to know all of them. For instance, here’s a quick graph of all of the instructions in systemctl on my system:

      With the top 15 or maybe to 25 of these instructions, you can probably write any program you can think of, and what’s missing will probably be easily found (just search for “multiply” or “divide”). You don’t need to know punpckldq to write a program.

      • luciferofastora@lemmy.zip
        link
        fedilink
        arrow-up
        0
        ·
        11 months ago

        What language is your pseudocode example modeled after? It vaguely reminds me of some iOs App code I helped debug (Swift?) but I never really learned the language so much as eyeballed it with educated guesses, and even with the few things I double checked it has been a few years, so I have no clue what is or isn’t legal syntax anymore.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        0
        ·
        11 months ago

        TIL. I had tried to learn it a bit, but felt lost pretty fast. Is there a good into to the basic instructions you’re aware of?

        By “play act the compiler” I mean a fairly elaborate system of written notes that significantly exceeds the size of the actual program. Like, it’s no wonder they started thinking about building machine compilers at that stage.