annotate level1/cmds/cobbler.asm @ 2193:97391b69843d

Modified size of dw3 format tracks
author boisy
date Wed, 11 Mar 2009 11:08:44 +0000
parents d141618d38df
children 2e7092ed1e10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
2 * Cobbler - Write OS9Boot to a disk
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
7 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
9 * 7 ????/??/??
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
10 * From Tandy OS-9 Level Two VR 02.00.01.
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
11 *
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
12 * 2002/07/20 Boisy G. Pitre
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
13 * Modified source to allow for OS-9 Level One and Level Two assembly.
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
14 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
15 * 2005/11/03 P.Harvey-Smith.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
16 * Added the ability to assemble for either CoCo or Dragon.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
17 *
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 nam Cobbler
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
20 ttl Write OS9Boot to a disk
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
22 * Disassembled 02/07/06 13:08:41 by Disasm v1.6 (C) 1988 by RML
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
24 IFP1
126
6b992a305a29 Changed a few labels
roug
parents: 0
diff changeset
25 use defsfile
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
26 ENDC
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 172
diff changeset
27
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
28 DOHELP set 0
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
29
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 atrv set ReEnt+rev
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 1304
diff changeset
32 rev set $00
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
33 edition set 7
260
1db453e3ce5f Added patch from Jan 1987 Rainbow, pg 203 to fix bitmap allocation bug
boisy
parents: 213
diff changeset
34
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 mod eom,name,tylg,atrv,start,size
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 172
diff changeset
36
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
37 org 0
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
38 lsn0buff rmb 26 Buffer to hold data from LSN0 of traget device
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
39 newbpath rmb 1
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
40 devpath rmb 3
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
41 EndDevName rmb 2 pointer to last character of device name when moving to fullbnam
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
42 fullbnam rmb 20 this buffer hodls the entire name (i.e. /D0/OS9Boot)
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
43 u0034 rmb 16
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
44 BootBuf rmb 7 Area to read part of current boot area into, to check for boot stuff
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
45 u004B rmb 2
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
46 LSNBitmapByte rmb 1 Saved byte from bitmap, of current LSN
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
47 u004E rmb 16
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
48 pathopts rmb 20
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
49 u0072 rmb 2
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
50 u0074 rmb 10
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
51 bffdbuf rmb 16
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
52 u008E rmb 1
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
53 u008F rmb 7
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
54 u0096 rmb 232
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
55 bitmbuf rmb 1024
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
56
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
57 IFGT Level-1
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
58 u057E rmb 76
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
59 u05CA rmb 8316
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
60 ENDC
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
61 size equ .
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 172
diff changeset
62
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 172
diff changeset
63 name fcs /Cobbler/
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 172
diff changeset
64 fcb edition
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 172
diff changeset
65
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
66 L0015 fcb $00
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
67 fcb $00
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
68
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
69 IFNE DOHELP
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
70 HelpMsg fcb C$LF
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
71 fcc "Use: COBBLER </devname>"
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
72 fcb C$LF
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
73 fcc " to create a new system disk"
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
74 fcb C$CR
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
75 ENDC
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
76 WritErr fcb C$LF
126
6b992a305a29 Changed a few labels
roug
parents: 0
diff changeset
77 fcc "Error writing kernel track"
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
78 fcb C$CR
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
79 fcb C$LF
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
80 fcc "Error - cannot gen to hard disk"
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
81 fcb C$CR
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
82
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
83 IFNE DRAGON
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
84 FileWarn fcb C$LF
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
85 fcc "Warning - not a Dragon "
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
86 fcb C$LF
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
87 fcc "disk."
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
88
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
89 ELSE
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
90 FileWarn fcb C$LF
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
91 fcc "Warning - file(s) present"
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
92 fcb C$LF
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
93 fcc "on track 34 - this track"
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
94
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
95 ENDC
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
96
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
97 fcb C$LF
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
98 fcc "not rewritten."
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
99 fcb C$CR
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
100 BootFrag fcb C$LF
126
6b992a305a29 Changed a few labels
roug
parents: 0
diff changeset
101 fcc "Error - OS9boot file fragmented"
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
102 fcb C$CR
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
103 IFGT Level-1
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
104 RelMsg fcb C$LF
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
105 fcc "Error - can't link to Rel module"
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
106 fcb C$CR
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
107 ENDC
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
108 BootName fcc "OS9Boot "
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
109 fcb $FF
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
110 RelNam fcc "Rel"
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 fcb $FF
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
112
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
113 DragonRootSec equ $12 Dragon root sector is always LSN 18
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
114
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
115 start clrb Check first char is a /
260
1db453e3ce5f Added patch from Jan 1987 Rainbow, pg 203 to fix bitmap allocation bug
boisy
parents: 213
diff changeset
116 lda #PDELIM
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 cmpa ,x
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
118 lbne ShowHelp
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
119
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
120 os9 F$PrsNam Parse the name
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
121 lbcs ShowHelp Error : show help
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
122
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
123 lda #PDELIM Check that path has only one / e.g. '/d1'
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 cmpa ,y
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
125 lbeq ShowHelp yes : show help
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
126
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
127 leay <fullbnam,u Transfer name to our buffer
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
128 L013C sta ,y+
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 decb
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
131 bpl L013C
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
132
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
133 sty <EndDevName Save pointer to end of dev name
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
134 ldd #PENTIR*256+C$SPAC Store '@ ' at end of devname, for entire dev e.g. '/d1@ '
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 std ,y++
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
136 leax <fullbnam,u Point to devname
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
137 lda #UPDAT. Open for update
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
138 os9 I$Open
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
139 sta <devpath Save pathnumber
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
140 lbcs ShowHelp Error opening dev, show help + exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
141
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
142 ldx <EndDevName Get pointer to end of dev name
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
143 leay >BootName,pcr Get pointer to boot file name
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
144 lda #PDELIM Append path delimiter e.g. '/d1/'
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
145 L0162 sta ,x+ Append boot name to dev name e.g. '/d1/OS9Boot'
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 lda ,y+
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
147 bpl L0162
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
148
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 pshs u
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
150 clra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
151 clrb
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
152 tfr d,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
153 tfr d,u
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
154 lda <devpath
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
155 os9 I$Seek seek to 0
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
156 lbcs Bye
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 puls u
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
158 leax lsn0buff,u Point to buffer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
159 ldy #DD.DAT $1A
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
160 lda <devpath
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
161 os9 I$Read read LSN0
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
162 lbcs Bye Error : exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
163
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
164 ldd <DD.BSZ get size of bootfile currently
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
165 beq L019F branch if none
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
166
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
167 leax <fullbnam,u
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
168 os9 I$Delete delete existing bootfile
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
169
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
170 clra
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 clrb
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
172 sta <DD.BT Init some of the LSN0 vars
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
173 std <DD.BT+1
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
174 std <DD.BSZ
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
175 lbsr WriteLSN0 Write back to disk
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
176
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
177 L019F lda #WRITE.
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
178 ldb #READ.+WRITE.
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
179 leax <fullbnam,u
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
180 os9 I$Create create new bootfile
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
181 sta <newbpath Save pathnumber
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
182 lbcs Bye branch if error
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
183
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
184 IFGT Level-1
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
185 * OS-9 Level Two: Copy first 90 bytes of system direct page into our space
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
186 * so we can figure out boot location and size, then copy to our space
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
187 leax >L0015,pcr
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
188 tfr x,d
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
189 ldx #$0000
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
190 ldy #$0090
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
191 pshs u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
192 leau >u057E,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
193 os9 F$CpyMem
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
194 lbcs Bye
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
195 puls u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
196 leax >L0015,pcr
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
197 tfr x,d
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
198 ldx >u05CA,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
199 ldy #$0010
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
200 pshs u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
201 leau <u004E,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
202 os9 F$CpyMem
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
203 puls u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
204 lbcs Bye
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
205 leax >u057E,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
206 ldd <D.BtPtr,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
207 pshs b,a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
208 ldd <D.BtSz,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
209 std <DD.BSZ
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
210 pshs b,a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
211 L01F7 ldy #$2000
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
212 cmpy ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
213 bls L0203
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
214 ldy ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
215 L0203 pshs y
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
216 leax <u004E,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
217 tfr x,d
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
218 ldx $04,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
219 pshs u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
220 leau >u057E,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
221 os9 F$CpyMem
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
222 lbcs Bye
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
223 puls u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
224 ldy ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
225 leax >u057E,u
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
226 lda <newbpath
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
227 os9 I$Write
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
228 lbcs Bye
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
229 puls b,a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
230 ldy $02,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
231 leay d,y
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
232 sty $02,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
233 nega
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
234 negb
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
235 sbca #$00
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
236 ldy ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
237 leay d,y
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
238 sty ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
239 bne L01F7
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
240 leas $04,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
241
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
242 ELSE
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
243
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
244 * OS-9 Level One: Write out bootfile
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
245 ldd >D.BTHI get bootfile size
260
1db453e3ce5f Added patch from Jan 1987 Rainbow, pg 203 to fix bitmap allocation bug
boisy
parents: 213
diff changeset
246 subd >D.BTLO
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
247 tfr d,y in D, tfr to Y
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
248 std <DD.BSZ save it
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
249 ldx >D.BTLO get pointer to boot in mem
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
250 lda <newbpath
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
251 os9 I$Write write out boot to file
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
252 lbcs Bye
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
253
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
254 ENDC
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
255
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
256 leax <pathopts,u Point to option buffer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
257 clrb Read option section of Path descriptor
1303
0006715970b5 Optimized, now uses Bt.Track symbolic
boisy
parents: 1300
diff changeset
258 * ldb #SS.Opt
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
259 lda <newbpath Get pathnumber of new bootfile
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
260 os9 I$GetStt Get options
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
261 lbcs Bye Error: exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
262
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
263 lda <newbpath Close bootfile
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
264 os9 I$Close
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
265
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
266 lbcs ShowHelp
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 pshs u
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
268 ldx <pathopts+(PD.FD-PD.OPT),u
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
269 lda <pathopts+(PD.FD+2-PD.OPT),u
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
270 * Now X and A hold file descriptor sector LSN of newly created OS9Boot
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 tfr d,u
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
273 lda <devpath
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
274 os9 I$Seek seek to os9boot file descriptor
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 puls u
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
276 lbcs Bye Error: exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
277
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
278 leax <bffdbuf,u Point to buffer for filedes sector
260
1db453e3ce5f Added patch from Jan 1987 Rainbow, pg 203 to fix bitmap allocation bug
boisy
parents: 213
diff changeset
279 ldy #256
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
280 os9 I$Read read in filedes sector
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
281 lbcs Bye Error: exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
282 ldd >bffdbuf+(FD.SEG+FDSL.S+FDSL.B),u Test if fragmented
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
283 lbne IsFragd branch if fragmented
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
284
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
285 * Get and save bootfile's LSN
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
286 ldb >bffdbuf+(FD.SEG),u
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
287 stb <DD.BT
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
288 ldd >bffdbuf+(FD.SEG+1),u
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
289 std <DD.BT+1
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
290 lbsr WriteLSN0 Write bootfile loc to LSN0 on disk
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
291
1303
0006715970b5 Optimized, now uses Bt.Track symbolic
boisy
parents: 1300
diff changeset
292 ldd #$0001
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
293 lbsr Seek2LSN
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
294 leax >bitmbuf,u Point to bitmap buffer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
295 ldy <DD.MAP Get block number of map
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
296 lda <devpath Get dev pathnumber
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
297 os9 I$Read read bitmap sector(s)
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
298 lbcs Bye Error: exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
299
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
300 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
301 * On the dragon, we do not need to test to see if the boot track has files on
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
302 * as the boot area is on track 0 imediatly after the blockmap, and before
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
303 * the root directory, and therefore can never have files on it.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
304 * However, we do need to verify that this is a Dragon formatted disk,
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
305 * we do this by checking that the root directory starts at LSN 18 (or greater).
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
306 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
307 ifne DRAGON
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
308 ldd <DD.DIR+1 Get LSN of root dir
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
309 cmpd #DragonRootSec Is this a dragon disk ?
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
310 beq RewriteBitmap Yes : write boot
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
311 lbra TrkAlloc No : error and exit.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
312 else
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
313
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
314 ldd #(Bt.Track*256)+Bt.Sec Get offset of boot track
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
315 ldy #$0004 Check 4 csectors
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
316 lbsr CheckAlloc
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
317 bcc L0304 Not allocated, check rest
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
318
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
319 ldd #(Bt.Track*256)+Bt.Sec Get offset of boot track
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
320 lbsr Seek2LSN
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
321 leax <BootBuf,u Point to buffer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
322 ldy #$0007 No of bytes to read
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
323 lda <devpath Get device path
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
324 os9 I$Read Do read
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
325 lbcs Bye Error : exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
326
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
327 leax <BootBuf,u Point to buffer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
328 ldd ,x Load first 2 bytes into D
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
329 cmpa #'O Check for presense of 'OS'
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
330 lbne TrkAlloc No: Try and allocate track (CoCo)
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
331 cmpb #'S
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
332 lbne TrkAlloc No: Try and allocate track (CoCo)
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
333
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
334 lda $04,x Check 5th byte is a NOP
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
335 cmpa #$12
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
336 beq L02F7 Yes: boot track already contains boot code
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
337
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
338 ldd #(Bt.Track*256)+Bt.Sec+$0F
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
339 ldy #$0003
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
340 lbsr CheckAlloc
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
341 lbcs TrkAlloc
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
342
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
343 L02F7 clra Allocate boot track (CoCo)
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
344 ldb <DD.TKS
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
345 tfr d,y
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
346 ldd #(Bt.Track*256)+Bt.Sec
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
347 lbsr Allocate
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
348 bra RewriteBitmap
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
349
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
350 L0304 ldd #(Bt.Track*256)+Bt.Sec+$04 Check to see if sectors 5..18 of boot track free
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
351 ldy #$000E Number of sectors
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
352 lbsr CheckAlloc Check them
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
353 lbcs TrkAlloc Carry set, sectors allocated, error & exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
354 bra L02F7
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
355
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
356 ENDC
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
357
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
358 RewriteBitmap
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
359 ldd #$0001
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
360 lbsr Seek2LSN Seek to bitmap sector on disk
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
361 leax >bitmbuf,u
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
362 ldy <DD.MAP
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
363 lda <devpath
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
364 os9 I$Write write updated bitmap
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
365 lbcs Bye
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
366
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
367 IFGT Level-1
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
368 * OS-9 Level Two: Link to Rel, which brings in boot code
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
369 pshs u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
370 lda #Systm+Objct
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
371 leax >RelNam,pcr
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
372 os9 F$Link
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
373 lbcs NoRel
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
374 tfr u,d tfr module header to D
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
375 puls u get statics ptr
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
376 subd #$0006
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
377 std <u004B,u save pointer
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
378 lda #$E0
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
379 anda <u004B,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
380 ora #$1E
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
381 ldb #$FF
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
382 subd <u004B,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
383 addd #$0001
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
384 tfr d,y
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
385 ldd #(Bt.Track*256)+Bt.Sec
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
386 lbsr Seek2LSN
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
387 lda <devpath
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
388 ldx <u004B,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
389
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
390 ELSE
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
391
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
392 * OS-9 Level One: Write out data at $EF00
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
393 ldd #(Bt.Track*256)+Bt.Sec Seek to boot track
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
394 lbsr Seek2LSN
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
395 lda <devpath
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
396 ldx #Bt.Start Get boot start and size
1300
636cabe76c6e Now Bt.Size is defined for Level One
boisy
parents: 924
diff changeset
397 ldy #Bt.Size
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
398
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
399 ENDC
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
400
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
401 os9 I$Write Write boot track
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
402 lbcs WriteBad Error
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
403 os9 I$Close Close devpath
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
404 lbcs Bye Error : exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
405 clrb Flag no error
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
406 lbra Bye
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
407
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
408 * Get absolute LSN
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
409 * Returns in D
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
410 AbsLSN pshs b
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
411 ldb <DD.FMT get format byte
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
412 andb #$01 check how many sides?
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
413 beq L037F branch if 1
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
414 ldb #$02 else assume 2
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
415 bra L0381
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
416 L037F ldb #$01
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
417 L0381 mul
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
418 lda <DD.TKS
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
419 mul
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
420 addb ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
421 adca #$00
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
422 leas $01,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
423 rts
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
424
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
425 * Returns bit in bitmap corresponding to LSN in A
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
426 * X=bitmap buffer, on exit X points to bitmap byte of our LSN
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
427 GetBitmapBit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
428 pshs y,b
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
429 * Divide D by 8
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
430 lsra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
431 rorb
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
432 lsra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
433 rorb
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
434 lsra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
435 rorb
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
436 leax d,x Point X at byte witin bitmap of our LSN ?
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
437 puls b
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
438 leay <BitTable,pcr Point to bit table
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
439 andb #$07 Make sure offset within table
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
440 lda b,y Get bit from table
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
441 puls pc,y Restore and return
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
442
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
443 BitTable fcb $80,$40,$20,$10,$08,$04,$02,$01 Bitmap bit table
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
444
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
445 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
446 * CheckAlloc, check to see if a block of sectors is allocated.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
447 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
448 * Entry : A=track, B= sector, Y=number of sectors
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
449 * Exit : Carry Set, sectors are already allocated. Carry clear, sectors are free.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
450 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
451 CheckAlloc
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
452 pshs y,x,b,a
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
453 bsr AbsLSN go get absolute LSN in D
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
454 leax >bitmbuf,u point X to our bitmap buffer
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
455 bsr GetBitmapBit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
456
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
457 sta ,-s save off
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
458 bmi L03CB
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
459
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
460 lda ,x Get bitmap byte of our LSN
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
461 sta <LSNBitmapByte Save for later use
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
462 L03BB anda ,s Is our LSN allocated ?
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
463 bne L03F7 Yes : flag error
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
464
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
465 leay -$01,y Decrement sector count
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
466 beq L03F3 All done : yes, exit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
467
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
468 lda <LSNBitmapByte Get saved bitmap byte
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
469 lsr ,s Check next sector
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
470 bcc L03BB If carry, we need to fetch next byte from bitmap
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
471
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
472 leax $01,x Increment bitmap pointer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
473 L03CB lda #$FF
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
474 sta ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
475 bra L03DB
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
476
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
477 L03D1 lda ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
478 anda ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
479 bne L03F7
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
480
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
481 leax $01,x
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
482 leay -$08,y
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
483 L03DB cmpy #$0008 Done a whole byte's worth of blocks ?
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
484 bhi L03D1 Yes
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
485 beq L03ED
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
486
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
487 lda ,s Fetch current bit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
488 L03E5 lsra Process next sector
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
489 leay -$01,y decrement sector count
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
490 bne L03E5 Any more : yes continue
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
491
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
492 coma
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
493 sta ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
494 L03ED lda ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
495 anda ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
496 bne L03F7
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
497
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
498 L03F3 andcc #^Carry
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
499 bra L03F9
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
500
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
501 L03F7 orcc #Carry Flag error ?
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
502 L03F9 leas $01,s Drop saved byte
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
503 puls pc,y,x,b,a Restore and return
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
504
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
505
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
506 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
507 * Allocate, allocate blocks in bitmap
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
508 * Entry : A=track, B=sector, Y=block count.
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
509 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
510
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
511 Allocate
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
512 pshs y,x,b,a
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
513 lbsr AbsLSN get absolute LSN
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
514 leax >bitmbuf,u Point to bitmap buffer
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
515 bsr GetBitmapBit Get bit corisponding to LSN
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
516
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
517 sta ,-s Save it
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
518 bmi L041C
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
519
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
520 lda ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
521 L040E ora ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
522 leay -$01,y
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
523 beq L043A
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
524
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
525 lsr ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
526 bcc L040E
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
527
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
528 sta ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
529 leax $01,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
530 L041C lda #$FF
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
531 bra L0426
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
532
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
533 L0420 sta ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
534 leax $01,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
535 leay -$08,y
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
536 L0426 cmpy #$0008
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
537 bhi L0420
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
538 beq L043A
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
539
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
540 L042E lsra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
541 leay -$01,y
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
542 bne L042E
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
543
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
544 coma
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
545 sta ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
546 lda ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
547 ora ,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
548 L043A sta ,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
549 leas $01,s
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
550 puls pc,y,x,b,a
168
3a847d2b4492 Cobbler, OS9Gen and format are all hardware dependent.
roug
parents: 126
diff changeset
551
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
552 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
553 * Seek To LSN, A=track, B=sector
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
554 *
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
555
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
556 Seek2LSN pshs u,y,x,b,a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
557 lbsr AbsLSN
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
558 pshs a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
559 tfr b,a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
560 clrb
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
561 tfr d,u
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
562 puls b
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
563 clra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
564 tfr d,x
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
565 lda <devpath
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
566 os9 I$Seek
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
567 bcs WriteBad
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
568 puls pc,u,y,x,b,a
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
569
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
570 WriteLSN0
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
571 pshs u added for OS-9 Level One +BGP+
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
572 clra
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
573 clrb
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
574 tfr d,x
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
575 tfr d,u
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
576 lda <devpath
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
577 os9 I$Seek Seek to LSN0
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
578
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
579 puls u added for OS-9 Level One +BGP+
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
580 leax lsn0buff,u Point to our LSN buffer
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
581 ldy #DD.DAT
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
582 lda <devpath
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
583 os9 I$Write Write to disk
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
584 bcs Bye branch if error
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
585 rts
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
586
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
587 ShowHelp equ *
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
588 IFNE DOHELP
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
589 leax >HelpMsg,pcr
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
590 ELSE
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
591 clrb
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
592 bra Bye
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 264
diff changeset
593 ENDC
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
594
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
595 DisplayErrorAndExit
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
596 pshs b
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
597 lda #$02
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
598 ldy #256
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
599 os9 I$WritLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
600 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
601 puls b
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
602 Bye os9 F$Exit
168
3a847d2b4492 Cobbler, OS9Gen and format are all hardware dependent.
roug
parents: 126
diff changeset
603
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
604 IsFragd leax >BootFrag,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
605 clrb
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
606 bra DisplayErrorAndExit
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
607
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
608 WriteBad leax >WritErr,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
609 clrb
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
610 bra DisplayErrorAndExit
172
1cd7548b534f Moved dragon64 specific commands to have _d64 as part of name, CoCo commands
boisy
parents: 168
diff changeset
611
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
612 TrkAlloc leax >FileWarn,pcr
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
613 clrb
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
614 bra DisplayErrorAndExit
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
615
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
616 IFGT Level-1
264
1ced4acebe44 edition 7 - from CoCo OS-9 Level Two version of cobbler with additions for
boisy
parents: 260
diff changeset
617 NoRel leax >RelMsg,pcr
1902
d141618d38df Can now be compiled to cobble CoCo or Dragon disks.
afra
parents: 1531
diff changeset
618 bra DisplayErrorAndExit
924
c155aac72190 Made cosmetic changes
boisy
parents: 921
diff changeset
619 ENDC
260
1db453e3ce5f Added patch from Jan 1987 Rainbow, pg 203 to fix bitmap allocation bug
boisy
parents: 213
diff changeset
620
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
621 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
622 eom equ *
260
1db453e3ce5f Added patch from Jan 1987 Rainbow, pg 203 to fix bitmap allocation bug
boisy
parents: 213
diff changeset
623 end