On Fri, May 15, 2026 at 7:51 AM Richard Cini <rich.cini@gmail.com> wrote:
Thanks Ken. I just tried that and it doesn’t help. I set a breakpoint at the command found address and typed a valid command name and it never reaches it. So, it has to be around where you’re looking. I’ve been using SIMH which is not great IMHO for tracing so I’m going to see if I can run this in another emulator with a debugger.
I think CMD_FOUND needs to increment DE 5 times, not 2. after XCHG, HL should then have the address needed for PCHL and none of the extra statements should be needed. It looks like the extra statements are if the command table contains indexes into another table of addresses. But if your command table contains subroutine addresses directly then "MOV A,M" through "MOV L,A" are unneeded. I pasted this code into https://eliben.org/js8080/ and it seemed to run ok. Note that I primed TBUFF with "AS " including the 2 trailing blanks that the STR_COMPARE routine requires. I assume that needing to put 2 spaces after "AS" is probably not desired but STR_COMPARE as written requires it. There is room for improvement in this code but I assume the first priority is to make it work. Making it small and fast can come later. lxi h, TBUFF mvi b, 1 lxi d, CTABLE LOOP: push h push d call STR_COMPARE jz CMD_FOUND pop d lxi h, 7 dad d xchg pop h dcr b jnz LOOP jmp CMD_NOT_FOUND CMD_FOUND: pop d pop h inx d inx d inx d inx d inx d xchg pchl CMD_NOT_FOUND: xra a ret STR_COMPARE: mvi c, 5 COMP_LOOP: ldax d cmp m rnz inx d inx h dcr c jnz COMP_LOOP xra a ret CTABLE: db 'AS ' db 0 dw 66 TBUFF: db 'AS ' db 0 ASSIGN: mvi a, 153 ret