‹ BackHN Continuity

Thread

Z80 REPL (2018)

160 points · 24 comments · adunk

Loading the complete thread in the background. This saved snapshot is available now. Refresh

  1. networked · · focus · HN ↗
    [delayed]
  2. j4cobgarby · · focus · HN ↗
    Really nice! Would be fun if there were a few examples that could be loaded into memory
  3. Marbleferry815 · · focus · HN ↗

    [dead]

  4. jottinger · · focus · HN ↗
    The source code for this is apparently 8 years old: <a href="https:&#x2F;&#x2F;github.com&#x2F;abagames&#x2F;z80-repl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;abagames&#x2F;z80-repl

    With that said, I love the idea.

    1. wkjagt · · focus · HN ↗
      That makes me love it even more
    2. NewsaHackO · · focus · HN ↗
      Yea, it doesn&#x27;t have that... uninspired design to it, looks like the design of someone who actually created it themselves.
      1. Jare · · focus · HN ↗
        Kenta Cho has created hundreds of games and toys over the past 20+ years. A lot of brilliant stuff.
  5. flyinghamster · · focus · HN ↗
    The one thing I lamented about the Apple II Plus (vs. the original with Integer BASIC) was that to make room for autostart, they had to rip out the mini-assembler in the Monitor ROM. That was the closest thing I ever saw to an assembly-language REPL before this. At least they were able to keep the disassembler.
    1. boomlinde · · focus · HN ↗
      It&#x27;s common in the C64 world to use freezer cartridges that allow you to interrupt normal operation and invoke a monitor program. These typically include rudimentary assemblers and disassemblers as well. Fun and useful for patching and reverse engineering!
      1. boomlinde · · focus · HN ↗
        Btw, I&#x27;ve only had a rough idea of how these are actually implemented, non-maskable interrupt something-something, and never knew how they make sure that the interrupt vector points to some persistent routine that can invoke the monitor. I found this great article explaining at least how The Final Cartridge 3 does it (in the first two sections): <a href="https:&#x2F;&#x2F;www.pagetable.com&#x2F;282" rel="nofollow">https:&#x2F;&#x2F;www.pagetable.com&#x2F;282
      2. Zeetah · · focus · HN ↗
        The Atari 8-bit computers could have a similar capability by using a product called Omnimon. Great way to look inside programs.
    2. abecedarius · · focus · HN ↗
      I felt the same way.

      There was another downside, that the Applesoft BASIC license gave Microsoft a hostage which they later used to kill <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;MacBASIC" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;MacBASIC. Hard to tell how much it mattered that the Mac launched with no user programmability, which had been expected for PCs till then.

      1. Gracana · · focus · HN ↗
        Wow, somehow I didn&#x27;t know about this. Now I&#x27;m angry, bundling an official Macintosh BASIC on every computer would have been huuuge for young-me.
    3. EvanAnderson · · focus · HN ↗
      I remember being so confused, as a 10 y&#x2F;o kid, trying to follow examples from an Apple II-era book on my public library&#x27;s Apple IIe computers. I didn&#x27;t understand why I couldn&#x27;t get the mini assembler to work. The idea that features would be removed on future machines simply didn&#x27;t occur to me. I guess I really didn&#x27;t even understand that the IIe was a different machine than what the book was written for.
      1. kevin_thibedeau · · focus · HN ↗
        The mini-assembler was still available from Integer BASIC on II+ and IIe. It returned to ROM for later IIe models.
        1. EvanAnderson · · focus · HN ↗
          It makes sense that I didn&#x27;t find it. Integer BASIC didn&#x27;t make sense to 10 y&#x2F;o me, either. I&#x27;d started with Applesoft, since it was in ROM, and Integer BASIC seemed needless and strange. I also didn&#x27;t understand why &quot;FP&quot; was the command to get into Applesoft.

          (These are yet more examples of situations where, if I&#x27;d had a mentor, I think I would have gone much further at a younger age.)

          1. MomsAVoxell · · focus · HN ↗
            I&#x27;m guessing you don&#x27;t still have the machine?

            In any case, Apple II simulators might be one way you can take another look at the subject, with wiser old eyes.

            1. EvanAnderson · · focus · HN ↗
              I got lucky and built a decent Apple II collection in the late 90s and early 2000&#x27;s before their prices became ridiculous. I bought an enhanced IIe first because that was closest to the computer I grew up with. Later I got a 48K II+ and was able to experience that era of Apple II computing. To round out the collection I got a ROM03 IIgs and decked it out with a memory upgrade and a BMoW Floppy Emu. I never was particularly interested in the IIc so I opted not to get one.

              My &quot;white whale&quot; machine was the Laser 128. A friend had one and I enjoyed using it. He&#x27;d bring it over to my house and hook it up to the TV. Having a portable computer in the late 80s, even if it wasn&#x27;t battery powered and didn&#x27;t have a screen, was pretty cool. I wish I&#x27;d bought it from him when he moved to PCs and sold it but at the time I didn&#x27;t realize it was a good find.

              I started using the Apple II when I was 8 y&#x2F;o, and got to the point of doing some simple 6502 assembler programming (mainly modifying programs from magazines). I left the platform at 12 y&#x2F;o when my father bought a PC.

              When I was 14 y&#x2F;o I scored a copy of the venerable &quot;Inside the Apple IIe&quot; cheap. I spent part of summer vacation that year really digging-in to the machine (from a software perspective). I didn&#x27;t have a IIe at home so I spent a of that summer at the public library using the old Apple IIe machines. The machines were getting long-in-the-tooth at that point and nobody else really used them anymore. I got as much time as I wanted on them. That was a fun contrast to the 1 hour &#x2F; day limit each person got back when I started using them.

              I feel fortunate I got to come back to the platform with a broader exposure to programming but while I still had the energy and exuberance of a teenager. I understood a lot more about what was going on and I was still willing to grind thru tedium. I had a lot of fun playing w&#x2F; double-hires graphics, digitizing audio via the cassette interface, and doing some rudimentary software cracking. It was a fun time.

              [0] <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;Inside_the_Apple_IIe" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;Inside_the_Apple_IIe

              1. MomsAVoxell · · focus · HN ↗
                Nice to hear your experience .. I myself have kept pretty much every system I’ve hacked on since 1978 in my personal collection[1] - or at least, where feasible. Anyway, it means about 50 years of computing history in my collection, which .. sooner or later .. I will have to turn over to others to maintain&#x2F;use&#x2F;do whatever, off into the future.

                The great thing about these machines, actually, is that .. you can always find a new user for an old machine.

                The 8-bit systems of today would give the 8-bit users of the decades past, positive conniptions at the mere concept that there are, pretty much every week or so, new releases for these ‘’ancient’’ systems ..

                Actually, kids learning computers these days -definitely need to know more about ancient computers- as a positively directed purpose.

                So, if you’ve got someone in your life who has the interest, all I can say is - crank out the old machine, turn it on, and do something fun&#x2F;useful with it.

                [1] Disclaimer: 40 years of computing, mostly in working order. Mostly missing the early things I bolted together myself in the outback HAM workshop where I first burned my fingers on building things ..

    4. ErroneousBosh · · focus · HN ↗
      The BBC Micro and the Atom that came before it had an assembler built into BASIC. Just think, in the early 80s you could do inline assembly if your BASIC code wasn&#x27;t fast enough...
      1. MomsAVoxell · · focus · HN ↗
        13 year old me had a box of cassette tapes with index labels like &quot;0 DEBUG&quot;, and &quot;10 ASS&quot;, and &quot;28 MEMHAK&quot;, &quot;30 UNDEL&quot;, and so on, where the #&#x27;s were the position - on tape - of the little bundle of utilities I would auto-load as soon as I got home from school, while having dinner, etc. I spent days, dreaming of having a ROM burner to put all these things in the last (usable) 16k address space of things ..
    5. MomsAVoxell · · focus · HN ↗
      Yes, I remember when this happened, it was a bummer .. but taught us the valuable lesson that the hardware manufacturer can give, but also take away. At least it kind of kicked off a tooling market ..

      Incidentally, apropos onboard assemblies, in my retro collection I have a Commodore PC running an ancient DOS, and it is unique because of two reasons: it has DEBUG.com, and .. the machine is infected with one of the very early viruses of the era.

      So, if you know the right path to take on boot, you can get the virus to infect things, under the debugger, and see it in action.

      DEBUG.com was for me, a complete boon of a tool, so to speak, back in the day. It was just enough assembler&#x2F;debugger to be able to do very effective things.

      Anyway, Z80 REPL is delightful, I want a 6502 REPL now, and can&#x27;t stop thinking about how to get one on the Atmos..

  6. torutofu · · focus · HN ↗
    the fun part is how fast you can get back into Z80 muscle memory once the repl is giving you immediate feedback
  7. [deleted] · · focus · HN ↗

    [deleted]

  8. corbinvachal · · focus · HN ↗

    [dead]

  9. jhallenworld · · focus · HN ↗
    Does it have symbols? The monitor on my 6800 &#x2F; 6809 Exorciser simulator has this:

        % a 1000
        1000: start bra skip
        1002:  nop
        1003:  nop
        1004: skip ldx #10
        Offset at 1001 set to 02
        1007: loop dex
        1008:  nop
        1009:  bne loop
        100b:  rts
        100c: 
        % sy
        1007 loop
        1004 skip
        1000 start
        % u 1000
        1000: 20 02               BRA $1004
        1002: 01                  NOP
        1003: 01                  NOP
        1004: CE 00 0A            LDX #$000A
        1007: 09                  DEX
        1008: 01                  NOP
        1009: 26 FC               BNE $1007
        100B: 39                  RTS
  10. ilaksh · · focus · HN ↗
    Is there screen memory or anything? How do I output a character?
    1. talideon · · focus · HN ↗
      You don&#x27;t. Just choose a block of RAM to write stuff to and use that. The block on the right shows the printable ASCII value of each address.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.