annotate 3rdparty/booters/boot_rom.asm @ 657:d2ce1c213a9c

Changed boot_ktlr and boot_tc3 to add id0 for SCSI ID
author boisy
date Sat, 21 Dec 2002 15:30:11 +0000
parents 3e3f1f79ba00
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
1 ********************************************************************
392
df43967d6a46 Minor source changes, added boot_burke
boisy
parents: 45
diff changeset
2 * Boot - OS-9 Level Two ROM Boot Module
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
3 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
4 * $Id$
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
5 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
8 * 1 Created BGP 98/??/??
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
9
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
10 nam Boot
392
df43967d6a46 Minor source changes, added boot_burke
boisy
parents: 45
diff changeset
11 ttl OS-9 Level Two ROM Boot Module
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
12
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
13 ifp1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
14 use defsfile
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
15 endc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
16
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
17 tylg set Systm+Objct
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
18 atrv set ReEnt+rev
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
19 rev set $01
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
20 edition set 1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
21
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
22 mod eom,name,tylg,atrv,start,size
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
23
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
24 size equ .
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
25
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
26 name fcs /Boot/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
27 fcb edition
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
28
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
29 start equ *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
30 * obtain bootfile size at known offset
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
31 pshs u,y,x,a,b,cc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
32 orcc #IntMasks mask interrupts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
33
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
34 * allocate memory from system
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
35 * memory will start at $8000, blocks 1, 2, 3 and 3F
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
36 * we allocate $100 bytes more so that the memory will start
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
37 * exactly at $8000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
38 ldd #$8000-$1300
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
39 os9 F$BtMem
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
40 bcs Uhoh
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
41
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
42 stu 3,s save pointer in X on stack
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
43 std 1,s save size in D on stack
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
44
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
45 * TRICK! Map block 4 into $4000, copy our special ROM copy code
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
46 * there, then jmp to it!
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
47 lda $FFA2
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
48 pshs a
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
49 lda #$04
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
50 sta $FFA2
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
51 ldd #RelCodeL code less than 256 bytes
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
52 leax RelCode,pcr
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
53 ldy #$4800
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
54 Copy lda ,x+
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
55 sta ,y+
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
56 decb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
57 bne Copy
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
58
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
59 Jump jsr $4800 * jump to rel code
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
60 puls a restore original block at $4000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
61 sta $FFA2
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
62
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
63 * Upon exit, we return to the kernel with:
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
64 * X = address of bootfile
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
65 * D = size of bootfile
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
66 * CC = carry cleared
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
67 ExitOK andcc #^Carry clear carry
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
68 Uhoh puls u,y,x,a,b,cc,pc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
69
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
70
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
71 * this code executes at $4800
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
72 RelCode equ *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
73 lda #$4E CC3 mode, MMU, 32K ROM
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
74 sta $FF90
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
75 sta $FFDE ROM/RAM mode
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
76
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
77 * Map ROM Blocks in
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
78 ldd #$3C3D
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
79 std $FFA4
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
80 lda #$3E
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
81 sta $FFA6
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
82
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
83 * Map block 1 at $6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
84 lda $FFA3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
85 pshs a
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
86 lda #$01
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
87 sta $FFA3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
88 * Copy first 8K of ROM
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
89 ldx #$8000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
90 ldy #$6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
91 Loop1 ldd ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
92 std ,y++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
93 cmpx #$A000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
94 blt Loop1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
95
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
96 * Map block 2 at $6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
97 lda #$02
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
98 sta $FFA3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
99 * Copy second 8K of ROM
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
100 ldx #$A000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
101 ldy #$6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
102 Loop2 ldd ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
103 std ,y++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
104 cmpx #$C000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
105 blt Loop2
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
106
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
107 * Map block 3 at $6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
108 lda #$03
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
109 sta $FFA3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
110 * Copy third 8K of ROM
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
111 ldx #$C000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
112 ldy #$6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
113 Loop3 ldd ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
114 std ,y++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
115 cmpx #$E000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
116 blt Loop3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
117
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
118 * Copy remaining ROM area ($8000-$1400)
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
119 lda #$3F
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
120 sta $FFA3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
121 ldx #$E000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
122 ldy #$6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
123 Loop4 clr $FFDE put in ROM/RAM mode to get byte
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
124 ldd ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
125 clr $FFDF put back in RAM mode to store byte
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
126 std ,y++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
127 cmpx #$EC00
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
128 blt Loop4
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
129 * ldx #$6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
130 * ldy #$E000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
131 *Loop5 ldd ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
132 * std ,y++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
133 * cmpx #$6C00
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
134 * blt Loop5
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
135
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
136 lda D.HINIT restore GIME HINIT value
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
137 sta $FF90
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
138 puls a restore org block at $6000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
139 sta $FFA3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
140 lda #$03
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
141 sta $FFA6
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
142 ldd #$0102
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
143 std $FFA4
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
144 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
145
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
146 RelCodeL equ *-RelCode
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
147
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
148 * Fillers to get to $1D0
459
3e3f1f79ba00 Sources now use 'fill' pseudo-op to fill out for L2 modules
boisy
parents: 392
diff changeset
149 Pad fill $39,$1D0-3-*
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
150
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
151 emod
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
152 eom equ *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
153 end