annotate level1/modules/boot_rampak.asm @ 3109:118cd9951d24

Small fixups in level 3 boot script And add it and the boot list to the coco3 build.
author Tormod Volden <debian.tormod@gmail.com>
date Sun, 28 Feb 2016 22:48:32 +0100
parents 0cf8513d33d7
children e0614e08fa5e
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
1965
7d14b2ce38c4 Added pointer to saved LSN0
afra
parents: 1894
diff changeset
49 LSN0Ptr rmb 2 In memory LSN0 pointer
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
50 size equ .
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
51
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
52 name equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
53 fcs /Boot/
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
54 fcb edition
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
55
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
56 use boot_common.asm
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
57
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
58 * HWInit - Initialize the device
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
59 * Entry: Y = hardware address
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
60 * Exit: Carry Clear = OK, Set = Error
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
61 * B = error (Carry Set)
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
62 HWInit lda >MPI.Slct get current slot
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
63 sta mpisave,u
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
64 lda >PakSlot,pcr get multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
65 bmi cont if >127, invalid slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
66 anda #$03 force it to be legal
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
67 ldb #$11
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
68 mul put it into both nibbles
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
69 stb >MPI.Slct go to the desired slot
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
70 cont clrb
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
71 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
72
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
73
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
74 * HWTerm - Terminate the device
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
75 * Entry: Y = hardware address
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
76 * Exit: Carry Clear = OK, Set = Error
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
77 * B = error (Carry Set)
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
78 HWTerm lda mpisave,u
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
79 sta >MPI.Slct
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
80 clrb
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
81 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
82
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
83
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
84 * 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
85 * Entry: Y = hardware address
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
86 * B = bits 23-16 of LSN
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
87 * X = bits 15-0 of LSN
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
88 * blockloc,u = ptr to 256 byte sector
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
89 * 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
90 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
91 sta 2,y save HB LSN
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
92 stb 1,y save LB LSN
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
93
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
94 ldx blockloc,u
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
95 clrb and start out at byte zero
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
96
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
97 ReadLp stb ,y save byte number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
98 lda 3,y grab the byte
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
99 sta ,x+ save in the buffer
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
100 incb go to the next byte
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
101 bne ReadLp
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
102 leax -256,x
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
103 clrb no errors
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
104 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
105
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
106 IFGT Level-1
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
107 Pad fill $39,$1D0-3-2-1-*
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
108 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
109
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
110 Address fdb $FF40 address of the device to boot from
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
111 PakSlot fcb $01 multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
112
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
113 emod
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
114 eom equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
115 end