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