2163
|
1 NAM bootman
|
|
2 TTL Boot Manager
|
|
3
|
|
4 BOOTTRACK equ 0
|
|
5
|
|
6 PSECT bootman,$11,0,0,0,entry
|
|
7
|
|
8 VSECT
|
|
9 ENDSECT
|
|
10
|
|
11 TOP EQU $FE00
|
|
12
|
|
13 * ORG $2600
|
|
14
|
|
15 * This code is executed first - it moves the actual boot manager code
|
|
16 * into high RAM so it is out of the way to load boot files
|
|
17 fcc "OS"
|
|
18 entry
|
|
19 lds #TOP-1 set stack to absolute TOP - 1
|
|
20 ldd #bmgrsiz get size of boot manager
|
|
21 pshs d save on stack
|
|
22 ldd #TOP get address at top
|
|
23 subd ,s++ subtract size of boot manager
|
|
24 clrb D now holds the address where we copy boot manager
|
|
25 deca minus 256 bytes for stack
|
|
26 deca minus 256 bytes for statics
|
|
27
|
|
28 pshs d save address for later
|
|
29
|
|
30 tfr d,u place boot manager's dest addr in U
|
|
31 ldd #bmgrsiz
|
|
32 leax bootmain,pcr
|
|
33 cloop ldy ,x++
|
|
34 sty ,u++
|
|
35 subd #$0002
|
|
36 bgt cloop
|
|
37
|
|
38 jmp ,s++ send control to moved code
|
|
39
|
|
40 * The entry point of the boot manager
|
|
41 * Entry: stack is set up, U points to static storage
|
|
42 csect
|
|
43 sectptr rmb 2
|
|
44 endsect
|
|
45
|
|
46 bootmain lbsr mach_init initialize the machine we're running on
|
|
47 lds #$FDFF set up stack
|
|
48 ldu #$F200 set up static storage
|
|
49 leax 256,u
|
|
50 stx sectptr,u
|
|
51 leax welcome,pcr
|
|
52 bsr writestr
|
|
53 loop bra loop
|
|
54
|
|
55
|
|
56 welcome fcc "NitrOS-9 Boot Manager"
|
|
57 fcb 0
|
|
58
|
|
59 * Helpful routines
|
|
60
|
|
61 * writestr - write string to output handler
|
|
62 * Entry:
|
|
63 * X = address of string (nul terminated)
|
|
64 writestr:
|
|
65 leay llio,pcr
|
|
66 writeloop
|
|
67 lda ,x+
|
|
68 beq writedone
|
|
69 jsr 3,y
|
|
70 bra writeloop
|
|
71 writedone
|
|
72 rts
|
|
73
|
|
74 bmgrsiz equ *-bootmain
|
|
75
|
|
76 endsect
|