another string assignment bugfix
This commit is contained in:
1 parent
c50595ab2d
commit
eefbaf76d8
4 files changed
+32
-8
No files matched your search
@@ -272,18 +272,35 @@ cmd_let_assign_string_not_text_area:
|
|||||||
|
|
||||||
cmd_let_assign_string_try_reuse:
|
cmd_let_assign_string_try_reuse:
|
||||||
|
|
||||||
// Check if size of both strings equals
|
// Check if we can reuse old string memory
|
||||||
|
|
||||||
|
sec
|
||||||
lda DSCPNT+0
|
lda DSCPNT+0
|
||||||
cmp __FAC1
|
sbc __FAC1+0
|
||||||
bne cmd_let_assign_string_try_reuse_unsuccesful
|
bcc cmd_let_assign_string_try_reuse_unsuccesful
|
||||||
|
|
||||||
|
// If size of both string equals - simply reuse it
|
||||||
|
|
||||||
// Size of both string equals, the old one belongs to the string area - simply reuse it
|
beq_16 helper_let_strvarcpy
|
||||||
|
|
||||||
jmp helper_let_strvarcpy
|
// Old string is longer - if difference is at least 3 bytes, we can still reuse it
|
||||||
|
|
||||||
|
sbc #$03
|
||||||
|
bcc cmd_let_assign_string_try_reuse_unsuccesful
|
||||||
|
|
||||||
|
// New string is shorter - enought that we can still reuse the old one with a small trick
|
||||||
|
/*
|
||||||
|
clc
|
||||||
|
adc DSCPNT+1
|
||||||
|
sta DSCPNT+1
|
||||||
|
bcs !+
|
||||||
|
inc DSCPNT+2
|
||||||
|
*/
|
||||||
|
// XXX
|
||||||
|
// XXX implement this part
|
||||||
|
// XXX
|
||||||
|
|
||||||
cmd_let_assign_string_try_reuse_unsuccesful:
|
cmd_let_assign_string_try_reuse_unsuccesful:
|
||||||
// XXX consider another optimization first: parial memory reuse
|
|
||||||
|
|
||||||
// No special case optimization is possible - but first get rid of the old string
|
// No special case optimization is possible - but first get rid of the old string
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -9,7 +9,10 @@
|
|||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_38K
|
#if CONFIG_MEMORY_MODEL_38K
|
||||||
|
|
||||||
helper_let_strdesccpy:
|
helper_let_strvarcpy:
|
||||||
|
|
||||||
|
// Retrieve pointer to destination
|
||||||
|
// XXX this part is probably not needed
|
||||||
|
|
||||||
ldy #$02
|
ldy #$02
|
||||||
lda (VARPNT), y
|
lda (VARPNT), y
|
||||||
@@ -19,6 +19,7 @@ helper_let_strvarcpy:
|
|||||||
sta CPU_R6510
|
sta CPU_R6510
|
||||||
|
|
||||||
// Retrieve pointer to destination
|
// Retrieve pointer to destination
|
||||||
|
// XXX this part is probably not needed
|
||||||
|
|
||||||
ldy #$02
|
ldy #$02
|
||||||
lda (VARPNT), y
|
lda (VARPNT), y
|
||||||
|
|||||||
+4
-1
@@ -9,10 +9,13 @@
|
|||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
#if CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
helper_let_strdesccpy:
|
helper_let_strvarcpy:
|
||||||
|
|
||||||
ldx #<VARPNT
|
ldx #<VARPNT
|
||||||
|
|
||||||
|
// Retrieve pointer to destination
|
||||||
|
// XXX this part is probably not needed
|
||||||
|
|
||||||
ldy #$02
|
ldy #$02
|
||||||
jsr peek_under_roms
|
jsr peek_under_roms
|
||||||
sta DSCPNT+2
|
sta DSCPNT+2
|
||||||
Reference in new issue
Block a user