; 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$ ; ; IPL for the CP/M-emu in an AVR. Loads CPM (CCP+BDOS+BIOS) from the 'disk'. ; Loads nsects (51) locical CPM sectors, starting from track 0 sector 2. maclib CFGACPM.LIB nsects equ 26*2 - 1 ;cold start sector count .z80 aseg org 100h .phase 2000h ld sp,2000h ld hl,msgipl call prmsg ld hl,ccp ld de,128 ld c,1 ;sector 1 ld b,nsects xor a out (16),a ;track 0 out (17),a ; loadloop: ld a,c ;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 shl READ_FUNC out (22),a add hl,de inc c dec b jp nz,loadloop jp bios prmsg: ld a,(hl) or a ret z out (2),a inc hl jp prmsg msgipl: db cr,lf db "ipl" db 0 end