]> cloudbase.mooo.com Git - avrcpm.git/blame - avrcpm/cpm/ipl.asm
From experimental:
[avrcpm.git] / avrcpm / cpm / ipl.asm
CommitLineData
fdcfcd44
L
1; CP/M IPL for avrcpm
2; Copyright (C) 2010 Sprite_tm
3;
4; This program is free software: you can redistribute it and/or modify
5; it under the terms of the GNU General Public License as published by
6; the Free Software Foundation, either version 3 of the License, or
7; (at your option) any later version.
8;
9; This program is distributed in the hope that it will be useful,
10; but WITHOUT ANY WARRANTY; without even the implied warranty of
11; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12; GNU General Public License for more details.
13;
14; You should have received a copy of the GNU General Public License
15; along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17org $2000
18 ; IPL for the CP/M-emu in an AVR. Loads CPM from the 'disk' from
19 ; track 0 sector 2 to track 1 sector 26.
20
21 ld sp,$1000
22
23 call printipl
24
25
26 ld b,49
27 ld de,$0001
28 ld hl,$3400+$A800
29loadloop:
30 ld a,d ;track
31 out (16),a
32 ld a,e ; sector (base-0)
33 out (18),a
34 ld a,l ;dma L
35 out (20),a
36 ld a,h ;dma H
37 out (21),a
38 ld a,1
39 out (22),a
40
41 push bc
42 ld bc,$80
43 add hl,bc
44 pop bc
45
46 inc e
47 ld a,e
48 cp 26
49 jp nz,noNextTrack
50
51 inc d
52 ld e,0
53
54noNextTrack:
55
56 dec b
57 jp nz,loadloop
58
59 jp $4A00+$A800
60
61printipl:
62 ld a,'i'
63 out (2),a
64 ld a,'p'
65 out (2),a
66 ld a,'l'
67 out (2),a
68 ld a,13
69 out (2),a
70 ld a,10
71 out (2),a
72 ret
73
74end