Recent submissions

Comment · 10 months ago
Well, I was pessimistic. Just pushed an update that slightly more than doubles the execution speed with a PR to the main depot pending. It is very close to 20 times faster than the original.
Comment · 10 months ago
Comment · 1 year ago
Comment · 3 years ago
Comment · 3 years ago
It is in the sense that Radio Shack put TRS-80 as a brand on all of their computers up until the mid eighties when they started to move into PC clones. Xroar emulates the Color Computer which was known as the "TRS-80 Color Computer".

Though, to be sure, most often TRS-80 is used to refer to the Model 1, 3, 4 line. But plenty of people will think of the Color Computer when they hear TRS-80. Or, possibly, their line of rebranded pocket and laptop computers like the TRS-80 Model 100 or TRS-80 Pocket Computer 1.

Comment · 3 years ago
The version for the Model 3 runs on stock hardware as it shipped in 1980. It has a interrupt that fires every second vblank. Thus it is possible to get in sync with the beam but to remain in sync the program must keep track of every cycle it executes.

The Model 1 version does require a hardware mod to get access to vsync.

I wrote those programs and couldn't have done it without something of a virtuous circle of trying stuff on the real hardware and then improving the emulator to more accurately model the hardware and so on.

Comment · 3 years ago
Comment · 4 years ago
That isn't a bug. In the original if a guess contains a repeated letter and there is only one occurrence of that letter in the target work then the first (on the left) letter will be yellow and the second black.

You can see this with today's word by guessing MOTTO. The leftmost T will be yellow and the rightmost will be black.

Similarly, if you guess TENET the initial T is black but the final T is green.

Today's word is ZBVFG (rot13).

Comment · 5 years ago
Comment · 6 years ago
And it could also save time. The Z-80 conditional return takes 5 cycles (or "T-States" in Zilog terminology) to execute if the condition is not met and 11 cycles otherwise. Quite worthwhile in testing for uncommon cases. Consider this routine to print a message that is terminated by nul or newline:

   PMESS  LD   A,(HL)     ; get character from message
          INC  HL         ; move message pointer to next character
          CP   10         ; newline?
          RET  Z          ; return if so
          OR   A          ; zero?
          RET  Z          ; done if so
          CALL PCHAR      ; print character
          JP   PMESS      ; keep looping
If instead of "RET Z" we had to do a conditional jump to a return it would be 10 cycles for each test instead of 5.

          CP   10
          JP   Z,DONE     ; 10 cycles, jump taken or not
          ...
          JP   PMESS
   DONE:  RET             ; 10 cycles, BTW
The conditional return just happens to be cheaper if not taken because it skips the work of popping the return address off the stack. Though purely an outcome of the implementation you can treat it as sort of a branch prediction.

Incidentally, the Z-80 also has relative branches (JR) that differ in execution time whether they are taken or not. The branch offset is a single byte so JR is only 2 bytes compared to JP's 3. A JR is 7 cycles if not taken, 12 otherwise. Again, we can treat it as a hard-coded branch prediction that predicts the branch is not taken. If space or distance to target is not a problem, a JR is faster if taken less than 60% of the time.

Comment · 6 years ago
The Z-80 stack pointer (SP) is a full 16 bit register. The stack can be anywhere in memory and be as large as needed.

The 6502 has only an 8 bit stack pointer which points into page 1 only (addresses 0x100 .. 0x1FF).

Comment · 6 years ago
Comment · 7 years ago
The Z-80 came out in 1976, three years before the 68000 and was an extension of the 8080. I don't see comparing the two as fair or sensible.
Comment · 7 years ago
Yes, enjoyable and good ideas. I feel like I've been on that "project" before. You do a bunch of work, dig into things and then discover a simple answer that, in hindsight, could have been applied immediately and made all the investigation irrelevant.

Usually out of pride or the sunk cost fallacy (or something like it) I'll convince myself there was no other way the problem was going to be solved. Either way the next time around I spend just a little bit longer trying to think of an easy way out.

Comment · 7 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton