]> cloudbase.mooo.com Git - avrcpm.git/blob - cpm/IPL.MAC
* cpm/utils/timer.mac
[avrcpm.git] / cpm / IPL.MAC
1 ; CP/M IPL for avrcpm
2 ;
3 ; Copyright (C) 2010 Sprite_tm
4 ;
5 ; This program is free software: you can redistribute it and/or modify
6 ; it under the terms of the GNU General Public License as published by
7 ; the Free Software Foundation, either version 3 of the License, or
8 ; (at your option) any later version.
9 ;
10 ; This program is distributed in the hope that it will be useful,
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; GNU General Public License for more details.
14 ;
15 ; You should have received a copy of the GNU General Public License
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
17 ;
18 ; $Id$
19 ;
20
21 ; IPL for the CP/M-emu in an AVR. Loads CPM (CCP+BDOS+BIOS) from the 'disk'.
22 ; Loads nsects (51) locical CPM sectors, starting from track 0 sector 2.
23
24 maclib CFGACPM.LIB
25
26 nsects equ 26*2 - 1 ;cold start sector count
27
28 .z80
29 aseg
30 org 100h
31 .phase 2000h
32
33 ld sp,2000h
34 ld hl,msgipl
35 call prmsg
36
37 ld hl,ccp
38 ld de,128
39 ld c,1 ;sector 1
40 ld b,nsects
41 xor a
42 out (16),a ;track 0
43 out (17),a ;
44 loadloop:
45 ld a,c ;sector (base-0)
46 out (18),a
47 ld a,l ;dma L
48 out (20),a
49 ld a,h ;dma H
50 out (21),a
51 ld a,1 shl READ_FUNC
52 out (22),a
53
54 add hl,de
55 inc c
56 dec b
57 jp nz,loadloop
58
59 jp bios
60
61 prmsg:
62 ld a,(hl)
63 or a
64 ret z
65 out (2),a
66 inc hl
67 jp prmsg
68
69 msgipl: db cr,lf
70 db "ipl"
71 db 0
72
73 end
74