]> cloudbase.mooo.com Git - avrcpm.git/blame - cpm/IPL.MAC
SVN --> GIT
[avrcpm.git] / cpm / IPL.MAC
CommitLineData
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
5482d75f
L
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
50302378
L
23\r
24 maclib CFGACPM.LIB\r
25\r
26nsects equ 26*2 - 1 ;cold start sector count\r
27\r
fc67ef42
L
28cr equ 0dh\r
29lf equ 0ah\r
30\r
50302378
L
31 .z80\r
32 aseg\r
33 org 100h\r
34 .phase 2000h\r
35\r
36 ld sp,2000h\r
37 ld hl,msgipl\r
38 call prmsg\r
39\r
50302378 40 ld hl,ccp\r
5482d75f
L
41 ld de,128\r
42 ld c,1 ;sector 1\r
43 ld b,nsects\r
44 xor a\r
45 out (16),a ;track 0\r
46 out (17),a ;\r
50302378 47loadloop:\r
5482d75f 48 ld a,c ;sector (base-0)\r
50302378
L
49 out (18),a\r
50 ld a,l ;dma L\r
51 out (20),a\r
52 ld a,h ;dma H\r
53 out (21),a\r
54 ld a,1 shl READ_FUNC\r
55 out (22),a\r
56\r
5482d75f
L
57 add hl,de\r
58 inc c\r
50302378
L
59 dec b\r
60 jp nz,loadloop\r
61\r
62 jp bios\r
63\r
64prmsg:\r
65 ld a,(hl)\r
66 or a\r
67 ret z\r
fc67ef42 68 out (UARTDR),a\r
50302378
L
69 inc hl\r
70 jp prmsg\r
71\r
72msgipl: db cr,lf\r
73 db "ipl"\r
74 db 0\r
75 \r
76 end\r
77\r