• KairuByte@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    3
    ·
    1 year ago

    Open source inherently means you can compile the code locally, for free. You can’t necessarily redistribute it, depending on the license, but I’m not aware of a “you can compile this source for testing and code changes only but if you use it as your actual copy you are infringing” license.

    I am very much open to correction here.

  • jadero@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    All those assembly language instructions are just mnemonics for the actual opcodes. IIRC, on the 6502 processor family, JSR (Jump to SubRoutine) was hex 20, decimal 32. So going deeper would be really limited to not having access to the various amenities provided by assembler software and writing the memory directly. For example:

    I started programming using a VIC-20. It came with BASIC, but you could have larger programs if you used assembly. I couldn’t afford the assembler cartridge, so I POKED the decimal values of everything directly to memory. I ended up memorizing some of the more common opcodes. (I don’t know why I was working in decimal instead of hex. Maybe the text representation was, on average, smaller because there was no need of a hex symbol. Whatever, it doesn’t matter…)

    VIC-BASIC had direct memory access via PEEK (retrieve value) and POKE (set value). It also had READ and DATA statements. READ retrieved values from the comma-delimited list of values following the DATA statement (usually just a big blob of values as the last line of your program).

    I would write my program as a long comma-delimited list of decimal values in a DATA statement, READ and POKE those values in a loop, then execute the resulting program. For small programs, I just saved everything as that BASIC program. For larger programs, I wrote those decimal values to tape, then read them into memory. That let me do a kind of modular programming by loading common functions from tape instead of retyping them.

    I was in the process of writing my own assembler so that I could use the mnemonics directly when I got my Apple //c. More memory and the availability of quite a few high level languages derailed me and I haven’t touched assembly since.

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 ℹ️@yiffit.net
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    edit-2
    1 year ago

    this isn’t too useful

    The point isn’t to be good, practical or useful. It’s to be cool 😎

    But this silly question still informed me of something I had misunderstood: I had thought assembly and machine code were the same thing.

  • ono@lemmy.ca
    link
    fedilink
    English
    arrow-up
    28
    arrow-down
    1
    ·
    1 year ago

    Cute. It would be funnier if it was correct.

  • Thorry84@feddit.nl
    link
    fedilink
    arrow-up
    23
    arrow-down
    1
    ·
    1 year ago

    For people interested in the difference between decompiled machine code and source code I would recommend looking at the Mario 64 Decomp project. They are attempting to turn a Mario 64 rom into source code and then back into that same rom. It’s really hard and they’ve been working on it for a long time. It’s come a long way but still isn’t done.

    https://github.com/n64decomp/sm64

      • Thorry84@feddit.nl
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        There is still some stuff that needs documenting, but the original goal of recompiling the created source code into the ROMs has been achieved. People are still actively working on it, so in that sense it’s maybe never done.

  • ono@lemmy.ca
    link
    fedilink
    English
    arrow-up
    15
    ·
    edit-2
    1 year ago

    Open source inherently means you can compile the code locally,

    Open Source means more than that. It is defined here:

    https://opensource.org/osd/

    If you use the phrase “open source” for things that don’t meet those criteria, then without some clarifying context, you are misleading people.

    for free.

    Free Software is not the same as “for free”. It, too, has a specific meaning. It is defined here:

    https://www.gnu.org/philosophy/free-sw.html.en

    When the person to whom you replied wrote “free software”, they were not using it is some casual sense to mean free-of-charge.

    • voxel@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      edit-2
      1 year ago

      well assembly is technically “source code” and can be 1:1 translated to and from binary, excluding “syntactic sugar” stuff like macros and labels added on top.

      • Malfeasant@lemm.ee
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        But those things you’re excluding are the most important parts of the source code…

      • 257m@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        The code is produced by the compiler but they are not the original source. To qualify as source code it needs to be in the original language it was written in and a one for one copy. Calling compiler produced assembly source code is wrong as it isn’t what the author wrote and their could be many versions of it depending on architecture.

  • Southern Wolf@pawb.social
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    It’s honestly remarkable how few people in the comments here seem to get the joke.

    Never stop dissecting things, y’all.

  • oldfart@lemm.ee
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    IDA Pro (a disassembler) is closed source but came with a license that allowed disassembly and binary modification. Unfortunately, that’s no longer the case.