help-circle
  • JoYo
    link
    fedilink
    English
    663 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.

    • @NocturnalMorning
      link
      183 months ago

      It’s just a joke friend.

      • JoYo
        link
        fedilink
        English
        -13 months ago

        I said so in my comment, try to keep up.

      • @[email protected]
        link
        fedilink
        English
        -243 months ago

        A very bad one if it requires switching off a large portion of your brain to find it funny.

  • Skull giver
    link
    fedilink
    43
    edit-2
    2 months ago

    deleted by creator

    • @[email protected]
      link
      fedilink
      183 months ago

      Assembly is hard, because you need to understand your problem on multiple levels and get absolute zero guidance by compilers.

      Even C guides you a tiny bit and takes away some of the low level details, so you have more mental capacity to actually solve your problem.

      Oh, and you have a standard library. Assembly seems to involve solving everything yourself. No simple function call to truncate a string or turn a char array to uppercase.

    • @[email protected]
      link
      fedilink
      63 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
        link
        fedilink
        English
        10
        edit-2
        2 months ago

        deleted by creator

        • @[email protected]
          link
          fedilink
          2
          edit-2
          3 months ago

          TIL. I had tried to understand it a bit, but felt lost pretty fast, and then eventually found out that’s because it’s huge. Is there a good intro 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.

        • @[email protected]
          link
          fedilink
          13 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.

          • Skull giver
            link
            fedilink
            1
            edit-2
            2 months ago

            deleted by creator

            • @[email protected]
              link
              fedilink
              13 months ago

              I’ve heard of Kotlin in the context of Android apps, but never actually used or learned it. I did one mobile app dev project with Java in Android Studio, but never had any formal classes on it either and just learned as I went (the result was shit, but we got a decent grade for being able to evaluate the difficulties and shortcomings and point out learnings).

    • @[email protected]
      link
      fedilink
      13 months ago

      Having toyed with video game reverse engineering, I definitely feel like I ought to learn a bit more. I understand mov, pointers and registers, and I think there was some inc and add in the code I read to try to figure out base pointers and pointer paths (using Cheat Engine), but I think knowing some more would serve me well there.

      • Skull giver
        link
        fedilink
        1
        edit-2
        2 months ago

        deleted by creator

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

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

    • @[email protected]
      link
      fedilink
      English
      193 months ago

      I saw a Scheme interpreter written in assembly running a C compiler written in Scheme.

        • @[email protected]
          link
          fedilink
          English
          4
          edit-2
          3 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.

    • @[email protected]
      link
      fedilink
      English
      13
      edit-2
      3 months ago

      Only the most very basic compilers. C compilers are in C mainly.

    • Noble Shift
      link
      103 months ago

      deleted by creator

    • @RestrictedAccount
      link
      43 months ago

      Back in High School in the 80’s me and a buddy wrote a Z-80 editor assembler in TRS-DOS BASIC.

      It was not rocket science.

      • davel [he/him]
        link
        fedilink
        English
        4
        edit-2
        3 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.

  • @geekworking
    link
    393 months ago

    Look at mister fancy pants with and assembler.

    How about entering straight opcode, operand with only a hex keypad and two pairs of 7 segment LEDs. You can only see one set of numbers at a time. You had to write it out on paper to be able to keep track and count positions so you don’t use your spot.

    I had to do this as a project in school. Two 8088 units that we breadboarded to a UART that we used to drive a fiber optic link to communicate with each other with a basic protocol. All descrete components hand wired and coded.

    It made you tie all of skills together into a full system of hardware and software.

    • @SidewaysHighways
      link
      133 months ago

      Alright you and Joe McMillan had a great weekend we get it

  • @jaybone
    link
    293 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.

    • @[email protected]
      link
      fedilink
      153 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
          link
          43 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.

      • @jaybone
        link
        63 months ago

        This was a long time ago. I’m pretty sure it was 8086.

    • Kairos
      link
      fedilink
      63 months ago

      Its still a thing

    • @czardestructo
      link
      53 months ago

      Required course work for electrical engineers in the early 2000s.

      • @trolololol
        link
        53 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

    • Cethin
      link
      fedilink
      English
      3
      edit-2
      3 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.

    • @[email protected]
      link
      fedilink
      2
      edit-2
      3 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.

  • @[email protected]
    link
    fedilink
    English
    26
    edit-2
    3 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 😊

    • @[email protected]
      link
      fedilink
      English
      9
      edit-2
      3 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.

  • Cethin
    link
    fedilink
    English
    243 months ago

    Anyone who thinks OP asking about Assembly with this meme should play the game Turing Complete. It’s great. You have to design a computer all the way from the most basic logic gates (I think you only get a NAND gate to start), designing an ALU and CPU, creating your own machine language, and writing your own programs in the language you designed, and it’s all simulated the whole time. Machine language is pretty advanced as far as things go.

    • @[email protected]
      link
      fedilink
      English
      133 months ago

      From your description this sounds more like a job in IBM’s R&D department than a game

      • Cethin
        link
        fedilink
        English
        123 months ago

        All the best games sound like jobs when you describe them.

        • @[email protected]
          link
          fedilink
          83 months ago

          factorio, satisfactory, oxygen not included, RimWorld, Stellaris, dwarf fortress, gregtech new horizons…

    • @[email protected]
      link
      fedilink
      83 months ago

      We got to do something simular in uni. We modeled the CPU in VHDL and had to set up our own language, then we were to program a game for it. One of the most fun and interesting courses we got to do!

  • @[email protected]
    link
    fedilink
    123 months ago

    It’s now been 18 years since the last time an employer paid me to write assembly, but it’s only been a year or so since the last time I had to read assembly at work (in order to verify what the compiler really was doing).

  • @LavenderDay3544
    link
    123 months ago

    OS and embedded dev here. I use assembly all the time. I’ve even worked on firmware that was entirely in assembly of strict requirements that couldn’t be met in C.

    Also even machine code hides a lot about how the underlying machine works so if you really want to do computing from scratch you really do hate to invent the universe because there’s abstractions all the way up the hardware stack just like there is in software.

  • @HStone32
    link
    113 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
      link
      63 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.

  • finley
    link
    fedilink
    English
    93 months ago

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

  • @[email protected]
    link
    fedilink
    83 months ago

    Ha! I teach assembly and use this one every year to lighten the mood before midterms.

  • Jo Miran
    link
    fedilink
    83 months ago

    In college back in 1991. Also had to do PASCAL and FORTRAN but thankfully those two were in a single course.

    • @expatriado
      link
      123 months ago

      I also took PASCAL in the 90s, but it is considered a high level language, and writes similarly to other high lvl languages, assembly has a very different syntax

      • Jo Miran
        link
        fedilink
        33 months ago

        Oh, I know. I meant that we had to take courses on older languages as part of the curriculum. That was a funky little college program. The oddest experience for me was taking Python back in the day as the “new thing” then not seeing it again until it absolutely exploded ~10 years ago. That program is also why I ended up playing with Linux so early on. The professors truly seemed to have a passion for emerging technologies while not wanting anyone to forget what came before. Thankfully, no punch cards.

      • @[email protected]
        link
        fedilink
        English
        23 months ago

        We used turbo pascal in school in the early 90’s. And it had assembly blocks… which I used copious amounts of because it was the only way to make the IBM PS/1’s do useful graphics.

  • AFK BRB Chocolate
    link
    English
    83 months ago

    I had an assembly class in college. I didn’t love of at all. Got my first job after graduating and it was writing space shuttle engine control software, which was in assembly. I was kind of surprised at how fast it became natural after dealing with it full time. Still, it felt luxurious when we upgraded the controller and could do the software in C.

    • @[email protected]
      link
      fedilink
      23 months ago

      yeah it was impossible for me in college until i spent 8 hours fucking with it and then had a dream in assembly…
      like, somehow using boxes in 3d to write “code” that then ran and moved other boxes around… i wish i could remember it exactly but when i woke up it all made sense to me and was pretty easy….

      • AFK BRB Chocolate
        link
        English
        13 months ago

        That’s cool, I wish my dreams were ever that useful

        • @[email protected]
          link
          fedilink
          23 months ago

          mine are usually just nightmares… or i don’t remember them… but that one time it was pretty useful.

          if you do some lucid dreaming exercises you can do stuff like that… but some say it can make you go crazy so i dunno… i quit.

  • TunaCowboy
    link
    7
    edit-2
    3 months ago

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