]> cloudbase.mooo.com Git - avrcpm.git/blame - cpm/ipl.asm
* I2C: Don't get stuck, if pullups are missing (timeout error)
[avrcpm.git] / 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/>.
53327777
L
16;
17; $Id$
18;
fdcfcd44 19
fc1c8e54
L
20cr: equ 13
21lf: equ 10
fdcfcd44 22
db568140
L
23READ_FUNC: equ 7
24WRITE_FUNC: equ 6
25BOOT_FUNC: equ 5
26HOME_FUNC: equ 4
27
fc1c8e54
L
28 org $2000
29 ; IPL for the CP/M-emu in an AVR. Loads CPM from the 'disk' from
30 ; track 0 sector 2 to track 1 sector 26.
31
fdcfcd44 32 ld sp,$1000
53327777
L
33 ld hl,msgipl
34 call prmsg
fdcfcd44 35
a54e22b7 36 ld b,51
fdcfcd44
L
37 ld de,$0001
38 ld hl,$3400+$A800
39loadloop:
40 ld a,d ;track
41 out (16),a
42 ld a,e ; sector (base-0)
43 out (18),a
44 ld a,l ;dma L
45 out (20),a
46 ld a,h ;dma H
47 out (21),a
db568140 48 ld a,1<<READ_FUNC
fdcfcd44
L
49 out (22),a
50
51 push bc
52 ld bc,$80
53 add hl,bc
54 pop bc
55
56 inc e
57 ld a,e
58 cp 26
59 jp nz,noNextTrack
60
61 inc d
62 ld e,0
63
64noNextTrack:
65
66 dec b
67 jp nz,loadloop
68
69 jp $4A00+$A800
70
53327777
L
71prmsg:
72 ld a,(hl)
73 or a
74 ret z
75 out (2),a
76 inc hl
77 jp prmsg
fdcfcd44 78
53327777
L
79msgipl: db cr,lf
80 db "ipl"
81 db 0
82
db568140 83end