2830
|
1 ******************************************************
|
|
2 * F$Debug entry point
|
|
3 *
|
|
4 * Enter the debugger (or reboot)
|
|
5 *
|
|
6 * Input: A = Function code
|
|
7 *
|
|
8
|
|
9 FDebug equ *
|
|
10 * Determine if this is a system process or super user
|
|
11 * Only they have permission to reboot
|
|
12 lda R$A,u
|
|
13 cmpa #255 reboot request
|
|
14 bne leave nope
|
|
15 ldx <D.Proc
|
|
16 ldd P$User,x get user ID
|
|
17 beq REBOOT
|
|
18 comb
|
|
19 ldb #E$UnkSvc
|
|
20 leave rts
|
|
21
|
|
22 * NOTE: HIGHLY MACHINE DEPENDENT CODE!
|
|
23 * THIS CODE IS SPECIFIC TO THE COCO!
|
|
24 REBOOT orcc #IntMasks turn off IRQ's
|
|
25 * clrb
|
|
26 * stb >$FFA0 map in block 0
|
|
27 * stb >$0071 cold reboot
|
|
28 * lda #$38 bottom of DECB block mapping
|
|
29 * sta >$FFA0 map in block zero
|
|
30 stb >$0071 and cold reboot here, too
|
|
31 ldu #$0000 force code to go at offset $0000
|
|
32 leax ReBootLoc,pc reboot code
|
|
33 ldy #CodeSize
|
|
34 cit.loop lda ,x+
|
|
35 sta ,u+
|
|
36 leay -1,y
|
|
37 bne cit.loop
|
|
38 * clr >$FEED cold reboot
|
|
39 * clr >$FFD8 go to low speed
|
|
40 jmp >$0000 jump to the reset code
|
|
41
|
|
42 ReBootLoc
|
|
43 * ldd #$3808 block $38, 8 times
|
|
44 * ldx #$FFA0 where to put it
|
|
45 *Lp sta 8,x put into map 1
|
|
46 * sta ,x+ and into map 0
|
|
47 * inca
|
|
48 * decb count down
|
|
49 * bne Lp
|
|
50
|
|
51 * lda #$4C standard DECB mapping
|
|
52 * sta >$FF90
|
|
53 * clr >$FF91 go to map type 0
|
|
54 clr >$FFDE and to all-ROM mode
|
|
55 ldd #$FFFF
|
|
56 * clrd executes as CLRA on a 6809
|
|
57 fdb $104F
|
|
58 tstb is it a 6809?
|
|
59 bne Reset yup, skip ahead
|
|
60 * ldmd #$00 go to 6809 mode!
|
|
61 fcb $11,$3D,$00
|
|
62 Reset jmp [$FFFE] do a reset
|
|
63 CodeSize equ *-ReBootLoc
|
|
64
|