changeset 118:cddbe8bc07e5

Don't clobber operator precedence flag when evaluating the starting term
author William Astle <lost@l-w.ca>
date Thu, 28 Dec 2023 22:00:32 -0700
parents 053fd2fb92e8
children a6a53e5c04bd
files src/expr.s
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/expr.s	Wed Dec 27 19:30:19 2023 -0700
+++ b/src/expr.s	Thu Dec 28 22:00:32 2023 -0700
@@ -12,7 +12,9 @@
 ;
 ; The special handling for relational operators is required because Basic allows them in all 
 eval_expr       clrb                            ; flag previous operator as minimum precdence (end of expression)
-eval_expraux    jsr eval_term                   ; evaluate the first term of the expression
+eval_expraux    pshs b                          ; save precedence flag
+                jsr eval_term                   ; evaluate the first term of the expression
+                puls b                          ; get back operator precedence flag
 eval_expr0      jsr curchar                     ; fetch current input
                 beq eval_expr1                  ; brif end of expression - we're done
                 cmpa #tok_or                    ; is it above operators?