Split from cpm repository
This commit is contained in:
commit
bf06e199fa
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.build/
|
18
Makefile
Normal file
18
Makefile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
BUILDDIR=.build
|
||||||
|
_BIN= putsys.bin
|
||||||
|
BIN = $(patsubst %,$(BUILDDIR)/%,$(_BIN))
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
all: $(BUILDDIR) $(BIN)
|
||||||
|
|
||||||
|
$(BUILDDIR)/%.bin: src/%.z80 | $(BUILDDIR)
|
||||||
|
@zasm -w -i $< -o $@
|
||||||
|
|
||||||
|
$(BUILDDIR):
|
||||||
|
@mkdir $(BUILDDIR)
|
||||||
|
|
||||||
|
all: $(BUILDDIR) $(BIN)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@rm -df $(BUILDDIR)/*.bin $(BUILDDIR)/*.lst .build
|
56
src/putsys.z80
Normal file
56
src/putsys.z80
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
;Copies the memory image of CP/M loaded at E400h onto tracks 0 and 1 of the first CP/M disk
|
||||||
|
;Load and run from ROM monitor
|
||||||
|
;Uses calls to BIOS, in memory at FA00h
|
||||||
|
;Writes track 0, sectors 2 to 26, then track 1, sectors 1 to 25
|
||||||
|
|
||||||
|
#target bin
|
||||||
|
#code _HOME, 0x1400
|
||||||
|
|
||||||
|
_bios equ (0x4A00+0xB000)
|
||||||
|
seldsk equ _bios+0x1b
|
||||||
|
settrk equ _bios+0x1e
|
||||||
|
setsec equ _bios+0x21
|
||||||
|
setdma equ _bios+0x24
|
||||||
|
write equ _bios+0x2a
|
||||||
|
|
||||||
|
monitor_warm_start equ 0x0433 ;Return to ROM monitor
|
||||||
|
|
||||||
|
main:
|
||||||
|
ld c,00h ;CP/M disk a
|
||||||
|
call seldsk
|
||||||
|
|
||||||
|
;Write track 0, sectors 2 to 51
|
||||||
|
ld a,1 ;starting sector
|
||||||
|
ld (sector),a
|
||||||
|
ld hl, 0x6400 ;start of CCP
|
||||||
|
ld (address),hl
|
||||||
|
ld c,0 ;CP/M track
|
||||||
|
call settrk
|
||||||
|
|
||||||
|
wr_trk_0_loop:
|
||||||
|
ld a,(sector)
|
||||||
|
ld c,a ;CP/M sector
|
||||||
|
call setsec
|
||||||
|
ld bc,(address) ;memory location
|
||||||
|
call setdma
|
||||||
|
call write
|
||||||
|
ld a,(sector)
|
||||||
|
cp 50 ;done:
|
||||||
|
jp z,done ;yes
|
||||||
|
inc a ;no, next sector
|
||||||
|
ld (sector),a
|
||||||
|
ld hl,(address)
|
||||||
|
ld de,128
|
||||||
|
add hl,de
|
||||||
|
ld (address),hl
|
||||||
|
jp wr_trk_0_loop
|
||||||
|
|
||||||
|
done:
|
||||||
|
jp 0x0000
|
||||||
|
|
||||||
|
sector:
|
||||||
|
db 00h
|
||||||
|
|
||||||
|
address:
|
||||||
|
dw 0000h
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user