Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_rampak.asm @ 1894:6d5bd8549d28
More booter optimizations
author | boisy |
---|---|
date | Mon, 17 Oct 2005 12:37:49 +0000 |
parents | 1827bb446188 |
children | 7d14b2ce38c4 |
rev | line source |
---|---|
1187 | 1 ******************************************************************** |
2 * Boot - Disto RAMPak Boot Module | |
3 * | |
4 * $Id$ | |
5 * | |
1287 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
1187 | 8 * ------------------------------------------------------------------ |
1287 | 9 * 5 ????/??/?? Alan DeKok |
10 * Created. | |
11 * | |
12 * 6 1998/10/20 Boisy G. Pitre | |
13 * Fixed small bugs, improved speed. | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
14 * |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
15 * 7 2005/10/14 Boisy G. Pitre |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
16 * Now uses boot_common.asm for fragmented bootfile support. |
1187 | 17 |
18 nam Boot | |
19 ttl Disto RAMPak Boot Module | |
20 | |
21 * Disassembled 94/06/25 11:37:47 by Alan DeKok | |
22 | |
1287 | 23 IFP1 |
1187 | 24 use defsfile |
1287 | 25 ENDC |
1187 | 26 |
27 tylg set Systm+Objct | |
28 atrv set ReEnt+rev | |
29 rev set $00 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
30 edition set 7 |
1187 | 31 |
32 mod eom,name,tylg,atrv,start,size | |
33 | |
1894 | 34 * Common booter-required defines |
35 LSN24BIT equ 0 | |
36 FLOPPY equ 0 | |
37 | |
38 | |
1187 | 39 * on-stack buffer to use |
40 org 0 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
41 mpisave rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
42 * common booter required static variables |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
43 ddtks rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
44 ddfmt rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
45 seglist rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
46 bootsize rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
47 blockloc rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
48 blockimg rmb 2 |
1187 | 49 size equ . |
50 | |
51 name equ * | |
52 fcs /Boot/ | |
53 fcb edition | |
54 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
55 use ../../6809l1/modules/boot_common.asm |
1187 | 56 |
1894 | 57 * HWInit - Initialize the device |
58 * Entry: Y = hardware address | |
59 * Exit: Carry Clear = OK, Set = Error | |
60 * B = error (Carry Set) | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
61 HWInit lda >MPI.Slct get current slot |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
62 sta mpisave,u |
1187 | 63 lda >PakSlot,pcr get multipak slot number |
64 bmi cont if >127, invalid slot number | |
65 anda #$03 force it to be legal | |
66 ldb #$11 | |
67 mul put it into both nibbles | |
68 stb >MPI.Slct go to the desired slot | |
1894 | 69 cont clrb |
70 rts | |
1187 | 71 |
72 | |
1894 | 73 * HWTerm - Terminate the device |
74 * Entry: Y = hardware address | |
75 * Exit: Carry Clear = OK, Set = Error | |
76 * B = error (Carry Set) | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
77 HWTerm lda mpisave,u |
1187 | 78 sta >MPI.Slct |
1894 | 79 clrb |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
80 rts |
1187 | 81 |
82 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
83 * HWRead - Read a 256 byte sector from the device |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
84 * Entry: Y = hardware address |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
85 * B = bits 23-16 of LSN |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
86 * X = bits 15-0 of LSN |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
87 * blockloc,u = ptr to 256 byte sector |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
88 * Exit: X = ptr to data (i.e. ptr in blockloc,u) |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
89 HWRead tfr x,d move 16 bit LSN into 2 8-bit registers |
1187 | 90 sta 2,y save HB LSN |
91 stb 1,y save LB LSN | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
92 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
93 ldx blockloc,u |
1187 | 94 clrb and start out at byte zero |
95 | |
96 ReadLp stb ,y save byte number | |
97 lda 3,y grab the byte | |
98 sta ,x+ save in the buffer | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
99 incb go to the next byte |
1187 | 100 bne ReadLp |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
101 leax -256,x |
1187 | 102 clrb no errors |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
103 rts |
1187 | 104 |
1287 | 105 IFGT Level-1 |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
106 Pad fill $39,$1D0-3-2-1-* |
1287 | 107 ENDC |
1187 | 108 |
109 Address fdb $FF40 address of the device to boot from | |
110 PakSlot fcb $01 multipak slot number | |
111 | |
112 emod | |
113 eom equ * | |
114 end |