annotate level1/modules/rel.asm @ 2438:a0d17254fbb3

rfm continues
author aaronwolfe
date Thu, 25 Feb 2010 00:09:32 +0000
parents 8cbd8013fe24
children 6e40b043d3e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
1 ********************************************************************
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
2 * REL - Relocation routine
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
3 *
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
4 * $Id$
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
5 *
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
7 * Comment
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
9 * 5r5 2003/07/31 Boisy G. Pitre
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
10 * Back ported NitrOS-9 REL to OS-9 Level Two.
1798
6a1f2b1eefb8 More updates
boisy
parents: 1727
diff changeset
11 *
6a1f2b1eefb8 More updates
boisy
parents: 1727
diff changeset
12 * 2004/11/09 P.Harvey-Smith
1727
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
13 * Added code to flip Dragon Alpha into text mode on boot.
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
14 *
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
15
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
16 nam REL
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
17 ttl Relocation routine
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
18
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
19 IFP1
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
20 use defsfile
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
21 ENDC
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
22
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
23 XX.Size equ 6 number of bytes before REL actually starts
1309
0a04945a7c60 Fixed bug in rel.asm, changed OS-9 Level One Bt.Start to $EE00 and Bt.Size to $1080 due to increased size of boot track using DriveWire booter.
boisy
parents: 1301
diff changeset
24 Offset equ Bt.Start+XX.Size
1854
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
25 IFEQ Level-1
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
26 ScStart equ $8000 screen start in memory
1854
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
27 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
28 ScStart equ $8008 screen start in memory
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
29 ENDC
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
30
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
31 tylg set Systm+Objct
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
32 atrv set ReEnt+rev
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
33 rev set $05
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
34 edition set 5
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
35
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
36 ********************************************************************
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
37 * Any changes to the next 3 lines requires changes in XX.Size, above
1301
4a50c6fb28b2 Fixed problem with copying at Bt.Start
boisy
parents: 1299
diff changeset
38 fcc /OS/ sync bytes
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
39 bra Start+XX.Size execution start
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
40 fdb $1205 filler bytes
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
41
1301
4a50c6fb28b2 Fixed problem with copying at Bt.Start
boisy
parents: 1299
diff changeset
42 Begin mod eom,name,tylg,atrv,start,size
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
43
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
44 org 0
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
45 size equ . REL doesn't require any memory
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
46
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
47 name fcs /REL/
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
48 fcb edition
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
49
1854
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
50 IFGT Level-1
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
51
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
52 L001F fcb $6C MMU, IRQ, Vector page, SCS
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
53 fcb $00 map type 0
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
54 fcb $00 no FIRQ
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
55 fcb $00 no IRQ
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
56 fdb $0900 timer
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
57 fcb $00 unused
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
58 fcb $00 unused
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
59 IFEQ TkPerSec-50
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
60 fcb $0B 50Hz refresh, alphanumeric display, 8 lines/char row
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
61 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
62 fcb $03 60Hz refresh, alphanumeric display, 8 lines/char row
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
63 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
64
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
65 IFEQ Width-80
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
66 fcb $34 200 lines, 80 column mode, no attribute byte (monochrome)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
67 fcb $3F white border
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
68 BOOTLINE set 11 80-col start line for BOOT/FAIL messages
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
69 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
70
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
71 IFEQ Width-40
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
72 fcb $24 200 lines, 40-col, no attribute byte
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
73 fcb $3F white border
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
74 BOOTLINE set 13 40-col start line for BOOT/FAIL messages
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
75 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
76
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
77 IFEQ Width-32
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
78 fcb $20 200 lines, 32-col, no attribute byte
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
79 fcb $00 black border
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
80 BOOTLINE set 13 32-col start line for BOOT/FAIL messages
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
81 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
82
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
83 fcb $00 display in lower 512k bank
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
84 fcb $00 vertical fine scroll set to 0
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
85 fcb Bt.Block*4 display block where-ever
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
86 fcb $01 offset 8 bytes
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
87 fcb $00 no horizontal scroll
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
88
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
89 crash lda #'* signal a crash error
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
90 jsr <D.BtBug
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
91 tfr b,a save error code
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
92 jsr <D.BtBug and dump this out, too
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
93 clrb
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
94 fcb $8C skip 2 bytes
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
95
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
96 reset equ * later on, have reset different from start?
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
97 start ldb #$FF negative - do complete boot
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
98 clr >$FFDF added for OS-9 ROM Kit boots +BGP+
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
99
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
100 start1 orcc #IntMasks turn off IRQ's
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
101 clr >PIA0Base+3 turn off SAM IRQ's
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
102 clra make A=0 for later
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
103 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
104 tfr 0,dp set direct page to $0000
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
105 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
106 tfr a,dp
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
107 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
108 clr <D.CBStrt cold boot start: don't re-boot on reset
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
109 clr >$FFA0 map in block 0
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
110 lds #$1FFF set stack to the end of the block
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
111 stb ,-s save status of start, $00=cold, $01=warm
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
112 * This is done so I can tell what went on in the direct page if there's
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
113 * a crash. 0(crash) 1(reset) -1(startup)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
114 beq Cont --don't clear out direct page if it's a crash
2249
8cbd8013fe24 rel: now we clear $00-$1F (direct page) in Level 2
boisy
parents: 2040
diff changeset
115 * BGP 12/24/2009: clear out ALL of direct page (even $00-$1F)
8cbd8013fe24 rel: now we clear $00-$1F (direct page) in Level 2
boisy
parents: 2040
diff changeset
116 * ldb #$20 start out at $20
8cbd8013fe24 rel: now we clear $00-$1F (direct page) in Level 2
boisy
parents: 2040
diff changeset
117 clrb
1854
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
118 tfr d,x here, too
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
119 L0072 sta ,x+ clear out the direct page
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
120 incb Boot won't be using any of it!
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
121 bne L0072 BUT RAMMER/MD DOES!!!
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
122 inc <D.Speed 0+1=1; high speed
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
123 Cont clrb --make sure B=0
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
124 stb >$FFD9 set to high speed
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
125 leay <L001F,pcr point to the video setup data
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
126 ldx #$0090 set video mapping
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
127 deca now D=$FF00, versus STU >-$0100,x (saves 1 byte)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
128 L0084 ldu ,y++ get the bytes
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
129 stu d,x save in the hardware
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
130 stu ,x++ and in the direct page
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
131 cmpx #$00A0 end of video hardware yet?
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
132 bcs L0084
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
133
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
134 IFEQ Width-32
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
135 ldd #$1200 color 0=$12, 1=$00 i.e. black on green
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
136 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
137 ldd #$3F00 color 0=$3F, 1=$00, i.e. black on white
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
138 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
139 std >$FFB0 set only the first two palettes, B=$00 already
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
140 lda #Bt.Block
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
141 sta >$FFA4 map in the block
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
142
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
143 ldx #$8000 start of the block
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
144 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
145 ldq #Bt.Flag*65536+8
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
146 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
147 ldd #Bt.Flag
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
148 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
149 tst ,s check status : 0(crash) 1(reset) -1(startup)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
150 bmi StoreQ if NOT a crash or reset, start at the start...
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
151 cmpd ,x are they the same?
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
152 beq MoveTxt don't bother clearing the screen if it's there
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
153 StoreQ
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
154 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
155 stq ,x otherwise save the bytes on-screen
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
156 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
157 std ,x
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
158 ldd #8
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
159 std 2,x
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
160 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
161
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
162 leax 8,x point to the start of the screen in memory
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
163 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
164 ldw #$2000-8 clear out the entire block of memory
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
165 leau <L00E0,pcr point to $20, a space
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
166 tfm u,x+ clear out the screen
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
167 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
168 ldy #$2000-8
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
169 ldb #$20
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
170 ClrLoop stb ,x+
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
171 leay -1,y
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
172 bne ClrLoop
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
173 * ldd #$2000-8
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
174 * ldu #$2020
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
175 *ClrLoop stu ,x++
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
176 * subd #$0002
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
177 * bne ClrLoop
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
178 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
179
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
180 MoveTxt leau <L0011,pcr point to OS-9 Welcome Message
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
181 bsr Move1 E=$00 already from TFM above...
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
182 * 0 = crash
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
183 * 1 = reset
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
184 * -1 = startup
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
185 ldb ,s+ check state of boot
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
186 bne L00E2 if OK, continue
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
187 * U=<L0019 already from TFM above (call to L00FD)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
188 bsr Move1 move it on-screen, E=$00 already
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
189 clr >$FF40 turn off disk drives
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
190 L00E0 bra L00E0 loop forever
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
191
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
192 Move1 ldy ,u++ get where to put the text
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
193 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
194 Move ldf ,u+ get the size of the block to move
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
195 L00FD tfm u+,y+
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
196 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
197 Move clra
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
198 ldb ,u+
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
199 tfr d,x
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
200 L00FD lda ,u+
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
201 sta ,y+
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
202 leax -1,x
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
203 bne L00FD
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
204 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
205 rts
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
206
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
207 L0011 fdb ScStart+(BOOTLINE*Width)+((Width-L1)/2)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
208 fcb L1 length of the text below
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
209 T1 equ *
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
210 fcc /NITROS9 BOOT/
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
211 L1 equ *-T1
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
212
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
213 fdb ScStart+((BOOTLINE+2)*Width)+((Width-LFail)/2)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
214 fcb LFail length of the 'FAILED' string
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
215 TFail fcc /FAILED/
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
216 LFail equ *-TFail
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
217
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
218 * saves 2 bytes over leax <L00E2,pc, cmpx #Bt.Start
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
219 L00E2 tfr pc,d get the address at which we're executing
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
220 cmpa #$26 the bootfile starts out at $2600
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
221 bne L0101 if not at $26xx, continue with booting
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
222 ldu #$2600 else move rel, Boot, OS9p1 over
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
223 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
224 ldw #$1200 size of track 34 boot file
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
225 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
226 ldx #$1200
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
227 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
228 ldy #Bt.Start where to put it
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
229 bsr L00FD 1 byte smaller than tfm in place
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
230 jmp >Offset+L0101
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
231
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
232 BtDebug pshs cc,d,x save the register
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
233 orcc #IntMasks turn IRQ's off
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
234 ldb #Bt.Block block to map in
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
235 stb >$FFA0 map the boot screen into block 0
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
236 ldx >$0002 where to put the bytes
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
237 sta ,x+ put the character on-screen
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
238 stx >$0002 save updated address
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
239 clr >$FFA0 map block 0 in again
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
240 puls cc,d,x,pc restore X and exit
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
241
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
242 L0101
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
243 lda #$7E RTS
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
244 sta <D.BtBug
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
245 leax <BtDebug,pc point to debug routine
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
246 stx <D.BtBug+1
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
247
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
248 leau <R.Crash,pcr point to D.Crash, D.CBStart
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
249 ldy #D.Crash move it over
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
250 bsr Move E=$00 from call to L00FD above.
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
251 IFNE H6309
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
252 ldmd #$03 go to native mode, FIRQ saves all registers
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
253 inc <D.MDREG 0+1=1; set MD shadow register (clr'd from above)
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
254 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
255
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
256 * leax <eom,pcr point to the end of REL
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
257 * ldd M$Size,x get size of the next module
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
258 * leax d,x skip Boot, point to OS9p1
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
259 ldx #$F000 we KNOW where OS9p1 starts in memory
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
260 ldd M$Exec,x get execution start address
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
261 jmp d,x jump to it
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
262
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
263 * D.Crash
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
264 R.Crash fcb $10 size of the data to move over
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
265 L003F clr >$FF91 go to map type 0 - called by CC3Go from map 1
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
266 jmp >Offset+crash
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
267
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
268 fcb $00 warm start flag
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
269 fdb $0074 go to $0074, next routine
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
270
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
271 * reset vector: map ROMs out and go to REL in the default DECB block map,
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
272 * which is still block $3F at the top fo memory
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
273 nop required for the ROMs to believe it's a reset vector
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
274 clr >$FFDF go to all RAM mode
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
275 jmp >Offset+reset and re-start the boot
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
276
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
277 Pad fill $39,$127-*
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
278
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
279 ELSE
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
280
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
281 start clr PIA0Base+3
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
282
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1854
diff changeset
283 IFNE (tano+d64+dalpha)
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
284 clr PIA0Base+1 added for Dragon, works on CoCo
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
285 ENDC
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
286
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
287 sta $FFDF turn off ROM
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
288 * locate Boot Text Screen at $8000
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
289 ldb #$06
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
290 ldx #$FFC6
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
291 L262B sta ,x++
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
292 decb
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
293 bne L262B
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
294 sta 1,x
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
295
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1854
diff changeset
296 IFNE dalpha
1727
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
297 clr $ffc0 * Reset to text mode if Dragon Alpha
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
298 clr $ffc2
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
299 clr $ffc4
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
300
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
301 lda $ff22
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
302 anda #$07
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
303 sta $ff22
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
304 ENDC
78ce0a5ffc8e Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents: 1709
diff changeset
305
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
306 * Clear VDG screen
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
307 ldx #ScStart
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
308 ldy #512
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
309 lda #$60
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
310 L263B sta ,x+
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
311 leay -1,y
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
312 bne L263B
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
313
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
314 * Copy "OS9 BOOT" to screen area
1375
805da58aa5b6 Fixed offset
boisy
parents: 1374
diff changeset
315 ldx #ScStart+$10A
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
316 leay <BootMsg,pcr
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
317 ldb #BootMLen
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
318 L2649 lda ,y+
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
319 sta ,x+
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
320 decb
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
321 bne L2649
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
322
2040
25b468210b37 More changes for new porting structure
boisy
parents: 1854
diff changeset
323 IFNE (tano+d64+dalpha)
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
324 tst <$72
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
325 ELSE
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
326 ldd #$1212
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
327 cmpd <$0078
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
328 ENDC
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
329
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
330 beq L266E
1301
4a50c6fb28b2 Fixed problem with copying at Bt.Start
boisy
parents: 1299
diff changeset
331 leau >Begin-XX.Size,pcr
4a50c6fb28b2 Fixed problem with copying at Bt.Start
boisy
parents: 1299
diff changeset
332 ldx #Bt.Size
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
333 ldy #Bt.Start
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
334 L2663 lda ,u+
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
335 sta ,y+
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
336 leax -1,x
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
337 bne L2663
1309
0a04945a7c60 Fixed bug in rel.asm, changed OS-9 Level One Bt.Start to $EE00 and Bt.Size to $1080 due to increased size of boot track using DriveWire booter.
boisy
parents: 1301
diff changeset
338 jmp >Offset+L266E
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
339 L266E leax <eom,pcr
1301
4a50c6fb28b2 Fixed problem with copying at Bt.Start
boisy
parents: 1299
diff changeset
340 ldd M$Exec,x
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
341 jmp d,x
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
342
1374
afe008eb9da1 NitrOS-9 boot message
boisy
parents: 1363
diff changeset
343 BootMsg fcc /NITROSy/
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
344 fcb $60
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
345 fcc /BOOT/
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
346 BootMLen equ *-BootMsg
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
347
1854
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
348 ENDC
59026f50b87f Rolled back changes to rel.asm.
cyouse
parents: 1849
diff changeset
349
1299
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
350 emod
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
351 eom equ *
1f0995cd0431 REL is now back-ported to OS-9 Level One
boisy
parents:
diff changeset
352 end