annotate level2/modules/kernel/fdebug.asm @ 3127:36061ff9e324

l2 kernel: Replaced literal FF91 and FFA* with symbolic references Zero functional changes; binaries equivalence verified by diff'ing the listing files before and after.
author Neal Crook <foofoobedoo@gmail.com>
date Mon, 28 Nov 2016 13:02:16 +0000
parents 039ddb7c8ad7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
1 ******************************************************
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
2 * F$Debug entry point
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
3 *
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
4 * Enter the debugger (or reboot)
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
5 *
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
6 * Input: A = Function code
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
7 *
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
8
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
9 FDebug equ *
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
10 * Determine if this is a system process or super user
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
11 * Only they have permission to reboot
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
12 lda R$A,u
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
13 cmpa #255 reboot request
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
14 bne leave nope
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
15 ldx <D.Proc
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
16 ldd P$User,x get user ID
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
17 beq REBOOT
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
18 comb
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
19 ldb #E$UnkSvc
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
20 leave rts
1145
ca83286ded5b Start of new OS-9 L2 Kernel
boisy
parents:
diff changeset
21
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
22 * NOTE: HIGHLY MACHINE DEPENDENT CODE!
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
23 * THIS CODE IS SPECIFIC TO THE COCO 3!
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
24 REBOOT orcc #IntMasks turn off IRQ's
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
25 clrb
3127
36061ff9e324 l2 kernel: Replaced literal FF91 and FFA* with symbolic references
Neal Crook <foofoobedoo@gmail.com>
parents: 3123
diff changeset
26 stb >DAT.Regs map in block 0
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
27 stb >$0071 cold reboot
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
28 lda #$38 bottom of DECB block mapping
3127
36061ff9e324 l2 kernel: Replaced literal FF91 and FFA* with symbolic references
Neal Crook <foofoobedoo@gmail.com>
parents: 3123
diff changeset
29 sta >DAT.Regs map in block zero
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
30 stb >$0071 and cold reboot here, too
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
31 ldu #$0000 force code to go at offset $0000
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
32 leax ReBootLoc,pc reboot code
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
33 ldy #CodeSize
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
34 cit.loop lda ,x+
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
35 sta ,u+
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
36 leay -1,y
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
37 bne cit.loop
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
38 clr >$FEED cold reboot
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
39 clr >$FFD8 go to low speed
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
40 jmp >$0000 jump to the reset code
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
41
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
42 ReBootLoc
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
43 ldd #$3808 block $38, 8 times
3127
36061ff9e324 l2 kernel: Replaced literal FF91 and FFA* with symbolic references
Neal Crook <foofoobedoo@gmail.com>
parents: 3123
diff changeset
44 ldx #DAT.Regs where to put it
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
45 Lp sta 8,x put into map 1
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
46 sta ,x+ and into map 0
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
47 inca
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
48 decb count down
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
49 bne Lp
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
50
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
51 lda #$4C standard DECB mapping
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
52 sta >$FF90
3127
36061ff9e324 l2 kernel: Replaced literal FF91 and FFA* with symbolic references
Neal Crook <foofoobedoo@gmail.com>
parents: 3123
diff changeset
53 clr >DAT.Task go to map type 0
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
54 clr >$FFDE and to all-ROM mode
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
55 ldd #$FFFF
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
56 * clrd executes as CLRA on a 6809
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
57 fdb $104F
3123
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
58 tstb is it a 6809?
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
59 bne Reset yup, skip ahead
039ddb7c8ad7 l2 kernel: Remove tabs and trailing whitespace, align comments
Neal Crook <foofoobedoo@gmail.com>
parents: 2829
diff changeset
60 * ldmd #$00 go to 6809 mode!
2829
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
61 fcb $11,$3D,$00
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
62 Reset jmp [$FFFE] do a reset
ed9a4cb85fb3 Fixed makefiles and defsfile for level 3
boisy
parents: 1145
diff changeset
63 CodeSize equ *-ReBootLoc