annotate level1/modules/boot_rampak.asm @ 1287:10957d54bf16

Made all modules rev 0
author boisy
date Sat, 30 Aug 2003 20:16:51 +0000
parents df263e490f85
children d669aab7d6d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
1 ********************************************************************
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
2 * Boot - Disto RAMPak Boot Module
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
3 *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
4 * $Id$
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
5 *
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
7 * Comment
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
9 * 5 ????/??/?? Alan DeKok
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
10 * Created.
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
11 *
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
12 * 6 1998/10/20 Boisy G. Pitre
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
13 * Fixed small bugs, improved speed.
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
14
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
15 nam Boot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
16 ttl Disto RAMPak Boot Module
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
17
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
18 * Disassembled 94/06/25 11:37:47 by Alan DeKok
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
19
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
20 IFP1
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
21 use defsfile
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
22 use rbfdefs
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
23 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
24
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
25 tylg set Systm+Objct
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
26 atrv set ReEnt+rev
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
27 rev set $00
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
28 edition set 6
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
29
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
30 mod eom,name,tylg,atrv,start,size
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
31
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
32 * on-stack buffer to use
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
33 org 0
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
34 size equ .
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
35
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
36 name equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
37 fcs /Boot/
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
38 fcb edition
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
39
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
40 start orcc #IntMasks ensure IRQ's are off.
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
41
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
42 pshs x,d save 4 bytes of junk
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
43 R.D equ 1
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
44 R.X equ 3
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
45
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
46 lda >MPI.Slct get current slot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
47 pshs a save off
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
48 lda >PakSlot,pcr get multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
49 bmi cont if >127, invalid slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
50 anda #$03 force it to be legal
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
51 ldb #$11
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
52 mul put it into both nibbles
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
53 stb >MPI.Slct go to the desired slot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
54
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
55 cont ldd #$0001 request one byte (will round up to 1 page)
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
56 os9 F$SRqMem request the memory
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
57 bcs L00AE exit on error
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
58 * U is implicitely the buffer address to use
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
59
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
60 ldx #$0000 X=0: got to sector #$0000
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
61 bsr GetSect load in LSN0, and point Y to the buffer
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
62 bcs L00AE
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
63
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
64 ldd <DD.BSZ,u size of the bootstrap file
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
65 std R.D,s save it on the stack (0,s is junk)
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
66 ldx <DD.BT+1,u get starting sector of the bootstrap file
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
67
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
68 pshs x save the starting sector number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
69 ldd #$0100 one page of memory
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
70 os9 F$SRtMem return the copy of LSN0 to free memory
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
71
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
72 ldd R.X,s get size of boot memory to request
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
73 IFGT Level-1
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
74 os9 F$BtMem ask for the boot memory
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
75 ELSE
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
76 os9 F$SRqMem ask for the boot memory
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
77 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
78 puls x restore the starting sector number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
79 bcs L00AE no memory: exit with error
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
80
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
81 stu R.X,s save start address of memory allocated
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
82 std R.D,s and the size of the boot memory
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
83 beq L00A7 if no memory allocated, exit
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
84
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
85 SectLp pshs x,d save sector #, size of boot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
86 bsr GetSect read one sector
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
87 bcs L00AC if there's an error, exit
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
88 puls x,d restor sector, size of boot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
89
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
90 leau $0100,u go up one page in memory
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
91 leax $01,x go to the next sector
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
92 subd #$0100 take out one sector, need value in B, too.
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
93 bhi SectLp loop until all sectors are read
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
94
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
95 L00A7 puls a
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
96 sta >MPI.Slct
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
97 clrb clear carry
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
98 puls d return size of boot memory to user
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
99 bra L00B0 and go exit
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
100
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
101 L00AC leas $04,s remove X,D off of stack
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
102 L00AE puls a
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
103 sta >MPI.Slct
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
104 leas $02,s kill D off of the stack
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
105
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
106 L00B0 puls x restore start address of memory allocated
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
107 * leas size,s remove the on-stack buffer
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
108 clr >DPort stop the disk
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
109 L00BA rts
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
110
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
111 * GetSect: read a sector off of the disk
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
112 * Entry: X = sector number to read
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
113 GetSect pshs d,x,y
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
114 ldy >Address,pcr grab the device address
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
115 tfr x,d move 16 bit LSN into 2 8-bit registers
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
116 sta 2,y save HB LSN
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
117 stb 1,y save LB LSN
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
118 leax ,u get buffer address to write into
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
119 clrb and start out at byte zero
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
120
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
121 ReadLp stb ,y save byte number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
122 lda 3,y grab the byte
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
123 sta ,x+ save in the buffer
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
124 incb go to the enxt byte
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
125 bne ReadLp
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
126 clrb no errors
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
127 puls d,x,y,pc restore registers and return
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
128
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
129 IFGT Level-1
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
130 Pad fill $39,$1D0-6-*
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
131 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
132
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
133 Address fdb $FF40 address of the device to boot from
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
134 PakSlot fcb $01 multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
135
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
136 emod
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
137 eom equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
138 end