mirror of
https://github.com/Klaus2m5/6502_EhBASIC_V2.22.git
synced 2024-06-08 03:29:29 +00:00
RAM above code / Ibuff above EhBASIC patch breaks STR$()
User mgcaret provided a fix
This commit is contained in:
parent
0a70ad5bd0
commit
eeab9858ff
|
@ -31,6 +31,9 @@ place and only a pointer needs to be set to the string location.
|
||||||
|
|
||||||
There is a bug in EhBASIC to determine where the string is.
|
There is a bug in EhBASIC to determine where the string is.
|
||||||
|
|
||||||
|
!! The original version of this patch broke the number to string conversion as
|
||||||
|
in STR$(). Github user mgcaret provided a fix included in version 2 !!
|
||||||
|
|
||||||
LAB_20DC
|
LAB_20DC
|
||||||
STX Sendh ; save string end high byte
|
STX Sendh ; save string end high byte
|
||||||
LDA ssptr_h ; get string start high byte
|
LDA ssptr_h ; get string start high byte
|
||||||
|
@ -42,14 +45,16 @@ below RAM_base. The fix requires the input buffer not to cross a page boundary:
|
||||||
LAB_20DC
|
LAB_20DC
|
||||||
STX Sendh ; save string end high byte
|
STX Sendh ; save string end high byte
|
||||||
LDA ssptr_h ; get string start high byte
|
LDA ssptr_h ; get string start high byte
|
||||||
; *** begin RAM above code / Ibuff above EhBASIC patch ***
|
; *** begin RAM above code / Ibuff above EhBASIC patch V2 ***
|
||||||
; *** replace
|
; *** replace
|
||||||
; CMP #>Ram_base ; compare with start of program memory
|
; CMP #>Ram_base ; compare with start of program memory
|
||||||
; BCS LAB_RTST ; branch if not in utility area
|
; BCS LAB_RTST ; branch if not in utility area
|
||||||
; *** with
|
; *** with
|
||||||
|
BEQ LAB_MVST ; fix STR$() using page zero via LAB_296E
|
||||||
CMP #>Ibuffs ; compare with location of input buffer page
|
CMP #>Ibuffs ; compare with location of input buffer page
|
||||||
BNE LAB_RTST ; branch if not in utility area
|
BNE LAB_RTST ; branch if not in utility area
|
||||||
; *** end RAM above code / Ibuff above EhBASIC patch ***
|
LAB_MVST
|
||||||
|
; *** end RAM above code / Ibuff above EhBASIC patch V2 ***
|
||||||
|
|
||||||
|
|
||||||
3. Output of some functions limited to integers is negative.
|
3. Output of some functions limited to integers is negative.
|
||||||
|
@ -163,7 +168,7 @@ LAB_142P
|
||||||
DEC Bpntrl ; allow for increment
|
DEC Bpntrl ; allow for increment
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
The conditional in the patch abover requires Ibuffs to be known at path 1 during
|
The conditional in the patch above requires Ibuffs to be known at pass 1 during
|
||||||
assembly. The standard definition of Ibuffs does not satisfy this requirement.
|
assembly. The standard definition of Ibuffs does not satisfy this requirement.
|
||||||
We need to replace it like below:
|
We need to replace it like below:
|
||||||
|
|
||||||
|
@ -188,6 +193,6 @@ during the inner loop if not in direct mode, but direct mode (Clineh = $FF) is
|
||||||
only cleared later in the same loop.
|
only cleared later in the same loop.
|
||||||
|
|
||||||
The fix is in the patched folder (version 2.22p2). The continue counter is now
|
The fix is in the patched folder (version 2.22p2). The continue counter is now
|
||||||
always saved and the decission to continue is postponed until the CONT statement
|
always saved and the decision to continue is postponed until the CONT statement
|
||||||
is executed and based on the fact that the continue pointer must not point to
|
is executed and based on the fact that the continue pointer must not point to
|
||||||
the input buffer in run mode.
|
the input buffer in run mode.
|
|
@ -22,6 +22,8 @@
|
||||||
; tabs converted to spaces, tabwidth=6
|
; tabs converted to spaces, tabwidth=6
|
||||||
; 2.22p2 fixed can't continue error on 1st statement after direct mode
|
; 2.22p2 fixed can't continue error on 1st statement after direct mode
|
||||||
; changed INPUT to throw "break in line ##" on empty line input
|
; changed INPUT to throw "break in line ##" on empty line input
|
||||||
|
; 2.22p3 fixed RAM above code / Ibuff above EhBASIC patch breaks STR$()
|
||||||
|
; fix provided by github user mgcaret
|
||||||
|
|
||||||
; zero page use ..
|
; zero page use ..
|
||||||
|
|
||||||
|
@ -4412,14 +4414,16 @@ LAB_20D0
|
||||||
LAB_20DC
|
LAB_20DC
|
||||||
STX Sendh ; save string end high byte
|
STX Sendh ; save string end high byte
|
||||||
LDA ssptr_h ; get string start high byte
|
LDA ssptr_h ; get string start high byte
|
||||||
; *** begin RAM above code / Ibuff above EhBASIC patch ***
|
; *** begin RAM above code / Ibuff above EhBASIC patch V2 ***
|
||||||
; *** replace
|
; *** replace
|
||||||
; CMP #>Ram_base ; compare with start of program memory
|
; CMP #>Ram_base ; compare with start of program memory
|
||||||
; BCS LAB_RTST ; branch if not in utility area
|
; BCS LAB_RTST ; branch if not in utility area
|
||||||
; *** with
|
; *** with
|
||||||
|
BEQ LAB_MVST ; fix STR$() using page zero via LAB_296E
|
||||||
CMP #>Ibuffs ; compare with location of input buffer page
|
CMP #>Ibuffs ; compare with location of input buffer page
|
||||||
BNE LAB_RTST ; branch if not in utility area
|
BNE LAB_RTST ; branch if not in utility area
|
||||||
; *** end RAM above code / Ibuff above EhBASIC patch ***
|
LAB_MVST
|
||||||
|
; *** end RAM above code / Ibuff above EhBASIC patch V2 ***
|
||||||
|
|
||||||
; string in utility area, move to string memory
|
; string in utility area, move to string memory
|
||||||
TYA ; copy length to A
|
TYA ; copy length to A
|
||||||
|
|
Loading…
Reference in New Issue
Block a user