# Z80 REPL bug: trailing space breaks instruction parsing

> Hacker News story 49814236 · language: en · submitted 2026-09-23
> Web version: https://zeli.app/story/49814236
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 158 · by [adunk](<https://news.ycombinator.com/user?id=adunk>) · 💬 20
[original](<https://abagames.github.io/z80-repl/index.html>) · [HN discussion](<https://news.ycombinator.com/item?id=49814236>)

## Summary

A Hacker News discussion of a Z80 REPL highlights a parsing bug: adding a trailing space after an instruction with no operands causes it to be treated as unknown. The commenter also wishes for fish-style Tab completion to cycle through suggestions without typing more characters.

## Key quote

> I also wish I could select from the completion list with Tab without typing more of the instruction, fish-style.

## HN discussion (20 comments)

### [jhallenworld](<https://news.ycombinator.com/item?id=49819160>)

> You should support symbols...  For example, the monitor on my 6800 / 6809 Exorciser simulator has this (the "Offset at..." is printed when it fixes forward references):
>
> ~/exorsim$ exor -d
>
> % 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
>
> What would be even better: "a" brings up a built-in mini-editor.  When you exit, the code is assembled.
>
> https://github.com/jhallen/exorsim

### [flyinghamster](<https://news.ycombinator.com/item?id=49815601>)

> 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.

### [jottinger](<https://news.ycombinator.com/item?id=49815519>)

> The source code for this is apparently 8 years old: https://github.com/abagames/z80-repl
>
> With that said, I love the idea.

---

## Cite

- Page: https://zeli.app/story/49814236
- Date: 2026-09-23
- Source: abagames.github.io (https://abagames.github.io/z80-repl/index.html)
- Hacker News: https://news.ycombinator.com/item?id=49814236

## Other languages

- zh: https://zeli.app/zh/story/49814236 · markdown: https://zeli.app/zh/story/49814236.md
- ja: https://zeli.app/ja/story/49814236 · markdown: https://zeli.app/ja/story/49814236.md
- ko: https://zeli.app/ko/story/49814236 · markdown: https://zeli.app/ko/story/49814236.md
- de: https://zeli.app/de/story/49814236 · markdown: https://zeli.app/de/story/49814236.md
- es: https://zeli.app/es/story/49814236 · markdown: https://zeli.app/es/story/49814236.md
- ru: https://zeli.app/ru/story/49814236 · markdown: https://zeli.app/ru/story/49814236.md
