From 1f241d42c808d0522a42d91f2bdc0aba4452bf3c Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 24 May 2020 22:42:28 -0400 Subject: [PATCH] infinite loop parsing the command table file I don't remember the full details because it was a few months ago but there was an infinite loop on statup when parsing the command table. --- src/shell/qasm2.s | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/shell/qasm2.s b/src/shell/qasm2.s index 89f3a12..33e5676 100644 --- a/src/shell/qasm2.s +++ b/src/shell/qasm2.s @@ -772,22 +772,28 @@ SetCmdHdl rts *------------------------------------------------------ +* _QAGetWord error +* $0000 -> no error +* $00xx -> no word, a = terminating character (anything less than $20, excluding \t ) +* $80xx -> qa tool error +* return value will always be 0,0 if there was an error. can never be 0,0 on success. +* :getword REP #$20 ;force 16 bit ]loop ~QAGetWord Ptr;endword;temp ;get a word plx ply - beq :0 ;don't modify if no word! - stx endword - sty begword bcc :1 - tax ;real error, or just no word? - bmi :1 + tax ; real error or no word? + bpl :0 + rts ; carry still set :0 inc endword ;no word- look for one! bra ]loop :1 + stx endword + sty begword SEP #$20 bra :gc ;get first char, uppercase!