MHN
Add a comment on Hacker News →
5 of 178 comments
  1. It's easy to relearn those skills:

    Just design and build a virtual CPU architecture in the language of your choice:) (not verilog but php, c, rust, zig or whatever)

    You create architecture, then OPCODES, then you can write simple programs in machine code.

    Then its SUPER EASY to write an assembler and disassembler.

    Then forth compiler.

    I did it all once as I was homeless on my phone in the mall .

    Fun and educational, even if you don't know assembly prior.

    1. I read a book on C that had this as an excercise; blew my mind at the time. It’s really a great excercise. I created and simulated an equihash machine this way many years ago; back when gpus were used for such thing as crypto mining and not ai!

  2. Follow-up question: how did Woz get BASIC into ROM?

    The handwritten interpreter is fairly common knowledge since Woz has told that story many times, but I don't recall any accounts of how he bridged the gap from paper to silicon. All of the discussion about the machine language monitor doesn't really address the question. At best, it moves the question from programming a ROM for BASIC to programming a ROM with the machine language monitor. Even with the monitor, additional hardware would be required to program a ROM. At the very least, a latch would be required to hold the address and data. Of course, it is possible that he did it without the computer (using a rig that let him "toggle" the pins). It is also possible that he used another computer to program the ROM, but, as he said, he didn't have the money to program BASIC on a computer so why would that be different for a ROM?

  3. And then he wrote SWEET16 which was also amazing. Him and Niklaus Wirth are two people I truly admire; they knew so much and shared so freely.

  4. For what it’s worth: when I used to do assembly on the commodore 64, after a while, your eyes are so used to seeing A9 close to LDA let you start knowing them by heart without even thinking. Of course this is possible on 6502 and will be way harder on modern CPUs. In the end of the number of common opcodes might have been 30-50, and you can always look up the rest from a one-page table.

    I remember that was a book that went on to say that you should learn machine code (that is, raw opcodes), not assembly, to program the c-64. Not sure I would agree, but it’s definitely feasible.

    The only thing that is strange in the Woz story is that you would usually start by creating a dirt-poor monitor/assembler so that you would have a sane environment to do further development in. That was the approach manuals from the era suggested for new hardware (eg Rodnay Zack’s)