annotate level1/modules/boot_rampak.asm @ 3169:1ff3d7673e36

mc09 l2: bring sys/makefile in line with latest organisation for other platforms Revise bootfiles/makefile to remove sysgo from bootfile - it can be found on the root of the disk.
author Neal Crook <foofoobedoo@gmail.com>
date Mon, 17 Apr 2017 22:59:28 +0100
parents e0614e08fa5e
children
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 *
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
4 * Provides HWInit, HWTerm, HWRead which are called by code in
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
5 * "use"d boot_common.asm
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
6 *
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
7 * $Id$
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 * Edt/Rev YYYY/MM/DD Modified by
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
10 * Comment
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
11 * ------------------------------------------------------------------
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
12 * 5 ????/??/?? Alan DeKok
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
13 * Created.
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
14 *
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
15 * 6 1998/10/20 Boisy G. Pitre
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
16 * Fixed small bugs, improved speed.
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
17 *
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
18 * 7 2005/10/14 Boisy G. Pitre
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
19 * Now uses boot_common.asm for fragmented bootfile support.
1187
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 nam Boot
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
22 ttl Disto RAMPak Boot Module
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
23
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
24 * Disassembled 94/06/25 11:37:47 by Alan DeKok
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
25
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
26 IFP1
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
27 use defsfile
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
28 ENDC
1187
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 tylg set Systm+Objct
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
31 atrv set ReEnt+rev
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
32 rev set $00
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
33 edition set 7
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
34
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
35 mod eom,name,tylg,atrv,start,size
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
36
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
37 * Common booter-required defines
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
38 LSN24BIT equ 0
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
39 FLOPPY equ 0
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
40
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
41
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
42 * on-stack buffer to use
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
43 org 0
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
44 mpisave rmb 1
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
45 * common booter required static variables
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
46 ddtks rmb 1
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
47 ddfmt rmb 1
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
48 seglist rmb 2
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
49 bootsize rmb 2
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
50 blockloc rmb 2
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
51 blockimg rmb 2
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
52 LSN0Ptr rmb 2 In memory LSN0 pointer
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
53 size equ .
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 name equ *
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
56 fcs /Boot/
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
57 fcb edition
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
58
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
59 use boot_common.asm
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
60
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
61 * HWInit - Initialize the device
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
62 * Entry: Y = hardware address
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
63 * Exit: Carry Clear = OK, Set = Error
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
64 * B = error (Carry Set)
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
65 HWInit lda >MPI.Slct get current slot
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
66 sta mpisave,u
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
67 lda >PakSlot,pcr get multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
68 bmi cont if >127, invalid slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
69 anda #$03 force it to be legal
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
70 ldb #$11
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
71 mul put it into both nibbles
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
72 stb >MPI.Slct go to the desired slot
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
73 cont clrb
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
74 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
75
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
76
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
77 * HWTerm - Terminate the device
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
78 * Entry: Y = hardware address
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
79 * Exit: Carry Clear = OK, Set = Error
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
80 * B = error (Carry Set)
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
81 HWTerm lda mpisave,u
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
82 sta >MPI.Slct
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
83 clrb
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
84 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
85
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
86
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
87 * 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
88 * Entry: Y = hardware address
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
89 * B = bits 23-16 of LSN
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
90 * X = bits 15-0 of LSN
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
91 * blockloc,u = ptr to 256 byte sector
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
92 * Exit: X = ptr to data (i.e. ptr in blockloc,u)
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
93 * Carry Clear = OK, Set = Error
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
94 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
95 sta 2,y save HB LSN
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
96 stb 1,y save LB LSN
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
97
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
98 ldx blockloc,u
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
99 clrb and start out at byte zero
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 ReadLp stb ,y save byte number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
102 lda 3,y grab the byte
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
103 sta ,x+ save in the buffer
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
104 incb go to the next byte
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
105 bne ReadLp
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
106 leax -256,x
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
107 clrb no errors
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
108 rts
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
109
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
110 IFGT Level-1
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
111 * L2 kernel file is composed of rel, boot, krn. The size of each of these
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
112 * is controlled with filler, so that (after relocation):
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
113 * rel starts at $ED00 and is $130 bytes in size
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
114 * boot starts at $EE30 and is $1D0 bytes in size
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
115 * krn starts at $F000 and ends at $FEFF (there is no 'emod' at the end
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
116 * of krn and so there are no module-end boilerplate bytes)
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
117 *
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
118 * Filler to get to a total size of $1D0. 3, 2, 1 represent bytes after
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
119 * the filler: the end boilerplate for the module, fdb and fcb respectively.
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents: 1533
diff changeset
120 Pad fill $39,$1D0-3-2-1-*
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 1187
diff changeset
121 ENDC
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
122
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
123 Address fdb $FF40 address of the device to boot from
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
124 PakSlot fcb $01 multipak slot number
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
125
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
126 emod
1187
df263e490f85 New booters added (moved from 3rdparty/booters)
boisy
parents:
diff changeset
127 eom equ *
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2049
diff changeset
128 end