• JoYo
    link
    fedilink
    English
    769 months ago

    I get the feeling that all of these assembly jokes are justifications to avoid learning assembly.

    You can still make syscalls in assembly. Assembly isnt magic. It isn’t starting from the creation of matter and energy, it’s just very specific code.

  • davel [he/him]
    link
    fedilink
    English
    529 months ago

    Assembly code is for writing C compilers, and C compilers are for writing Lisp interpreters.

      • davel [he/him]
        link
        fedilink
        English
        6
        edit-2
        9 months ago

        I never did get very far with the TRS-80 Editor Assembler, but that was my first exposure to such things.

        I also remember the BASIC code for the Dancing Daemon which was replete with PEEKs and POKEs, such that much of it was written in machine code.

        • @RestrictedAccount@lemmy.world
          link
          fedilink
          24 months ago

          Exactly how we did it too. We created the editor/assembler that peeked to see what was there and display it in Assembly, Hexadecimal, and ASCII.

          You could edit whichever version you wanted and it would Poke it into RAM.

          You could also save swaths to a file.

        • @henfredemars@infosec.pub
          link
          fedilink
          English
          5
          edit-2
          9 months ago

          There’s actually good reasons for this design. It’s easy to write a Scheme interpreter in assembly, but it’s hard to write a C compiler in assembly that handles everything correctly. Much rather write it in higher level language if possible and Scheme lowers the bar to getting there, so you can get away from using assembly as quickly as possible. Or you can copy somebody else’s Scheme implementation of a C compiler because now you’re platform independent.

          Then you can write your C compiler in C (or steal a better compiler already written in C) and close the loop. For your final step, you use the C compiler to compile itself.

  • r00ty
    link
    fedilink
    29 months ago

    I used to write z80 asm without an assembler back when I was a LOT younger. The ZX spectrum manual I had, had the full instruction list with the byte values.

    I think it was oddly easier than some higher level languages for some tasks.

    But, making changes was an utter nightmare.

  • Moah
    link
    fedilink
    19 months ago

    I used to make video games entirely in assembly

  • TunaCowboy
    link
    fedilink
    8
    edit-2
    9 months ago

    Syscalls are sitting right there, and you can always just link libc…

  • @MyNameIsRichard@lemmy.ml
    link
    fedilink
    69 months ago

    Only on the VIC20 and Atari STe. On the VIC20 you had to write the assembler, manually convert it to machine code and enter that into the computer. There was a cartridge with an assembler, debugger and an extra 3.5Kb memory for it but I never got one.

    • @stanka@lemmy.ml
      link
      fedilink
      29 months ago

      Vic 20 was my first. I watched my dad struggle with and eventually give up on assembly. Something-something and the microbots. I was fearful of it until I took Assembly at Uni. That 2nd/3rd year class was where the final puzzle piece of how computers work fell in place for me.

      My first job was writing assembly tests for a DSP hardware design team. Fell in love. Never looked back.

  • finley
    link
    fedilink
    English
    109 months ago

    I remember watching assembly demos in the early-mid 90s and thinking those guys were wizards

  • @abcd@feddit.org
    link
    fedilink
    English
    28
    edit-2
    9 months ago

    IMHO assembly isn’t hard. When you gain enough experience you start to see „visual patterns“ in your code. For example jumping over some lines often equals to a if/else statement or jumping back is often a loop etc. Then you are able to skim code without the necessity to read each line.

    The most difficult part is to keep track of the big picture because it is so verbose. Otherwise it’s a handful or two of instructions you use 90+% of the time.

    I needed it often in the past in the PLC world but it is dying out slowly. Nonetheless, when I encounter 30+ year old software I’m happy to be able to get along. And your experience transitions to other architectures like changing from one higher language to another.

    Nonetheless, if I’m able to choose, I’ll take Go. Please and thank you 😊

    • @wewbull@feddit.uk
      link
      fedilink
      English
      9
      edit-2
      9 months ago

      The most difficult part is to keep track of the big picture because it is so verbose. Otherwise it’s a handful or two of instructions you use 90+% of the time.

      It’s a long time since I wrote any assembly in anger, but I don’t remember this being an issue. Back then Id be writing 2D and 3D graphics demos. Reasonably complex things, but the challenge was always getting it fast enought to keep the frame rate up, not code structure.

      As you say, I think you just establish patterns to decompose the problem.

  • @HStone32@lemmy.world
    link
    fedilink
    119 months ago

    Not exactly accurate, I think. Even machine language is bound by the CPU’s architecture. You can’t do anything in machine language that wasn’t specifically provided for by the CPU architects.

    It would be more accurate to say it’s like creating a new universe using all the same laws of physics, thermodynamics, cosmology, ethics, etc as our existing universe.

    • @UNY0N@lemmy.world
      link
      fedilink
      69 months ago

      I don’t think accuracy was the goal, it is a joke not a dissertation. It’s more about how it feels to try a language like assembly after working with higher-level languages.

  • @NauticalNoodle@lemmy.ml
    link
    fedilink
    5
    edit-2
    9 months ago

    I’ve been studying Arm Aarch32 lately. I have a software development academic background but I have always been interested in Architecture.

  • Hanrahan
    link
    fedilink
    English
    79 months ago

    Not since the 1980s on a Commodore 64.

    SYS64738

  • @jaybone@lemmy.world
    link
    fedilink
    309 months ago

    Assembly used to be a required course for CS undergrads in the 90s. Is that no longer the case?

    Also we had to take something called Computer Architecture, which was like an EE class designing circuits with gates and shit.

      • @trolololol@lemmy.world
        link
        fedilink
        59 months ago

        I had to learn assembly but was one topic of many we handled in architecture. Like one question of one exam. That was one of the toughest professors we had, class was about 2001

    • @luciferofastora@lemmy.zip
      link
      fedilink
      2
      edit-2
      9 months ago

      I attended two different Bachelor’s courses, one with a very technical (2016-2018) and one with a more high level focus (2018-2023). The first did have a class where we learned how to go from logic gates to a full ALU as well as some actual EE classes, but I didn’t go far enough or memorise the list of classes to remember whether Assembly would have become a thing. We learned programming with first Processing, then C and C++.

      The second had C as an elective course, and that was as technical and low-level as it ever got.

    • Cethin
      link
      fedilink
      English
      3
      edit-2
      9 months ago

      I think the university I went to phased out the EE requirements the year after me. Honestly, I think it should be required. Understanding how the computer “thinks” is such an important skill.

    • @CanadaPlus@lemmy.sdf.org
      link
      fedilink
      169 months ago

      Which target did you use? Having to learn even a fraction of modern x86 would be ridiculous, but SPARC or something could be good to know, just to reduce the “magic box” effect.

        • @trolololol@lemmy.world
          link
          fedilink
          49 months ago

          I learned mips as graduate. In undergrad had to build with logic gates for things like 2 digit decimal counter and my architecture classes were diagram blocks for a simple CPU. But by that time we knew how to do moderate complexity circuits in VHDL simulation, and we had to make a simple VHDL circuit run for real in FPGA.