cas_noisy: equ #bc6b
cas_out_open: equ #bc8c
cas_out_close: equ #bc8f
cas_out_direct: equ #bc98
kl_rom_walk: equ #bccb
ams_dos_work_ram_ptr: equ #be7d
;---------------------------------------------------------------------------
org #4000
;------------------------------------------------------------------------
; store the drive number the loader was run from
ld hl, (ams_dos_work_ram_ptr)
ld a, (hl)
ld (drive + 1), a ; self-modifying code
call kl_rom_walk ; enable all roms
drive:
ld a, 0
ld hl, (ams_dos_work_ram_ptr)
ld (hl), a
ld a, #ff
call cas_noisy ; disable error messages
; copy data to the place where we want it to be loaded again:
ld hl, data
ld de, #9f00
ld bc, data_end - data
ldir
ld b, filename_end - filename
ld hl, filename
ld ix, #9f00
ld de, data_end - data
call save_block
loop:
jp loop
;------------------------------------------------------------------------
; input:
; - b: length of filename
; - hl: address of filename
; output:
; - carry: success
; - no carry: error
save_block:
push ix
push de
ld de, #c000 ; temporary buffer
call cas_out_open
pop de
pop hl
ret nc ; error
ld b, h
ld c, l
ld a, 2 ; binary data
call cas_out_direct
ret nc
jp cas_out_close
;------------------------------------------------------------------------
filename:
db "data2.bin"
filename_end:
data:
db "writtendata", 0, 1, 2, 3, 4, 5, 6, 7
data_end:
Page created in 0.045 seconds with 16 queries.