let total_length=bas_end-bas_run
.basic_run
ld hl,end_rom
ld de,&a000
ld bc,total_length
ldir
jp &a000
.end_rom
let rom_tlength=end_rom-start_rom
let sub_addr=rom_tlength+old_addr
list
org &a000,sub_addr
nolist
.bas_run
ld hl,(length)
ld bc,&170
add hl,bc
ld c,0
call kl_rom_select
ld a,(&c002)
cp 0
jp z,cpc464
ld (&ae66),hl
ld (&ae68),hl
ld (&ae6a),hl
ld (&ae6c),hl
cp 1
jp z,cpc664
jp &ea78
.cpc664
jp &ea7d
.cpc464
ld (&ae83),hl
ld (&ae85),hl
ld (&ae87),hl
ld (&ae89),hl
jp &e9bd
.bas_end
list
end