; 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 from the 'disk' from ; track 0 sector 2 to track 1 sector 26. 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 b,nsects ld de,0001h ;track 0, sector 1 ld hl,ccp 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 shl READ_FUNC out (22),a push bc ld bc,128 add hl,bc pop bc inc e ld a,e cp 26 jp nz,noNextTrack inc d ld e,0 noNextTrack: 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