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
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.
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
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 nam Boot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
19 ttl Disto RAMPak Boot Module
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
20
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
21 * Disassembled 94/06/25 11:37:47 by Alan DeKok
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
22
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
23 IFP1
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
24 use defsfile
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
25 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
26
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
27 tylg set Systm+Objct
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
28 atrv set ReEnt+rev
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
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 mod eom,name,tylg,atrv,start,size
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
33
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
34 * Common booter-required defines
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
35 LSN24BIT equ 0
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
36 FLOPPY equ 0
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
37
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
38
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
39 * on-stack buffer to use
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
49 size equ .
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
50
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
51 name equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
52 fcs /Boot/
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
53 fcb edition
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
56
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
57 * HWInit - Initialize the device
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
58 * Entry: Y = hardware address
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
59 * Exit: Carry Clear = OK, Set = Error
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
63 lda >PakSlot,pcr get multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
64 bmi cont if >127, invalid slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
65 anda #$03 force it to be legal
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
66 ldb #$11
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
67 mul put it into both nibbles
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
68 stb >MPI.Slct go to the desired slot
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
69 cont clrb
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
70 rts
1187
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
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
73 * HWTerm - Terminate the device
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
74 * Entry: Y = hardware address
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
75 * Exit: Carry Clear = OK, Set = Error
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
78 sta >MPI.Slct
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
79 clrb
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
80 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
81
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
90 sta 2,y save HB LSN
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
94 clrb and start out at byte zero
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
95
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
96 ReadLp stb ,y save byte number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
97 lda 3,y grab the byte
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
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
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
104
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
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
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
107 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
108
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
109 Address fdb $FF40 address of the device to boot from
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
110 PakSlot fcb $01 multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
111
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
112 emod
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
113 eom equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
114 end