I have created 2 patches. They haven't been tested to the full extend and so I can't be sure that they don't break anything else for now!
Patch to fix the string compare of equal strings in direct mode returning FALSE:
Code:
; variable name set-up
; get (var), return value in FAC_1 and $ flag
LAB_1C18
JSR LAB_GVAR ; get (var) address
STA FAC1_2 ; save address low byte in FAC1 mantissa2
STY FAC1_3 ; save address high byte in FAC1 mantissa3
LDX Dtypef ; get data type flag, $FF=string, $00=numeric
BMI LAB_1C25 ; if string then return (does RTS)
LAB_1C24
JMP LAB_UFAC ; unpack memory (AY) into FAC1
LAB_1C25
; *** begin patch string pointer high byte trashed when moved to stack
; *** add
LSR FAC1_r ; clear bit 7 (<$80) = do not round up
; *** end patch
RTS
Patch to fix FALSE value stored to a variable after string compare is not exactly zero:
Code:
; perform LET
LAB_LET
JSR LAB_GVAR ; get var address
STA Lvarpl ; save var address low byte
STY Lvarph ; save var address high byte
LDA #TK_EQUAL ; get = token
JSR LAB_SCCA ; scan for CHR$(A), else do syntax error then warm start
LDA Dtypef ; get data type flag, $FF=string, $00=numeric
PHA ; push data type flag
JSR LAB_EVEX ; evaluate expression
PLA ; pop data type flag
ROL ; set carry if type = string
; *** begin patch result of a string compare stores string pointer to variable
; but should store FAC1 (true/false value)
; *** replace
; JSR LAB_CKTM ; type match check, set C for string
; BNE LAB_17D5 ; branch if string
; *** with
JSR LAB_CKTM ; type match check, keep C (expected type)
BCS LAB_17D5 ; branch if string
; *** end patch
JMP LAB_PFAC ; pack FAC1 into variable (Lvarpl) and return
; string LET
LAB_17D5
The patches above will eventually make it into my patched version of EhBASIC and my list of bugs supplied with the original version of EhBASIC. Now I am ready to have breakfast.