annotate 3rdparty/booters/boot_rampak.asm @ 459:3e3f1f79ba00

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