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