]>
Commit | Line | Data |
---|---|---|
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 (CCP+BDOS+BIOS) from the 'disk'.\r | |
22 | ; Loads nsects (51) locical CPM sectors, starting from track 0 sector 2.\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 hl,ccp\r | |
38 | ld de,128\r | |
39 | ld c,1 ;sector 1\r | |
40 | ld b,nsects\r | |
41 | xor a\r | |
42 | out (16),a ;track 0\r | |
43 | out (17),a ;\r | |
44 | loadloop:\r | |
45 | ld a,c ;sector (base-0)\r | |
46 | out (18),a\r | |
47 | ld a,l ;dma L\r | |
48 | out (20),a\r | |
49 | ld a,h ;dma H\r | |
50 | out (21),a\r | |
51 | ld a,1 shl READ_FUNC\r | |
52 | out (22),a\r | |
53 | \r | |
54 | add hl,de\r | |
55 | inc c\r | |
56 | dec b\r | |
57 | jp nz,loadloop\r | |
58 | \r | |
59 | jp bios\r | |
60 | \r | |
61 | prmsg:\r | |
62 | ld a,(hl)\r | |
63 | or a\r | |
64 | ret z\r | |
65 | out (2),a\r | |
66 | inc hl\r | |
67 | jp prmsg\r | |
68 | \r | |
69 | msgipl: db cr,lf\r | |
70 | db "ipl"\r | |
71 | db 0\r | |
72 | \r | |
73 | end\r | |
74 | \r |