Files
open-roms/src/basic/engine_variables/helper_strconcat_46K_50K.s
T
2020-07-19 08:54:53 +02:00

54 lines
748 B
ArmAsm

// #LAYOUT# STD * #TAKE-HIGH
// #LAYOUT# * BASIC_0 #TAKE-HIGH
// #LAYOUT# * * #IGNORE
// This has to go $E000 or above - routines below banks out the main BASIC ROM!
//
// Helper routine for string concatenation
//
#if CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
helper_strconcat:
// Unmap BASIC lower ROM
lda #$26
sta CPU_R6510
// Copy data from the first string
ldy #$00
!:
lda (__FAC2+1),y
sta (INDEX),y
iny
cpy __FAC2+0
bne !-
// Increase INDEX pointer by the size of the 1st string
tya
jsr helper_INDEX_up_A
// Copy data from the second string
ldy #$00
!:
lda (__FAC1+1),y
sta (INDEX),y
iny
cpy __FAC1+0
bne !-
// Restore default memory mapping
lda #$27
sta CPU_R6510
rts
#endif