; CP/M IPL for avrcpm
; Copyright (C) 2010 Sprite_tm
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see .
;
; $Id$
;
org $2000
; IPL for the CP/M-emu in an AVR. Loads CPM from the 'disk' from
; track 0 sector 2 to track 1 sector 26.
READ_FUNC: equ 7
WRITE_FUNC: equ 6
BOOT_FUNC: equ 5
HOME_FUNC: equ 4
ld sp,$1000
ld hl,msgipl
call prmsg
ld b,51
ld de,$0001
ld hl,$3400+$A800
loadloop:
ld a,d ;track
out (16),a
ld a,e ; sector (base-0)
out (18),a
ld a,l ;dma L
out (20),a
ld a,h ;dma H
out (21),a
ld a,1<