Mercurial > hg > Members > kono > nitros9-code
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 |
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 | 4 * Enter the debugger (or reboot) |
1145 | 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 | 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 | |
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 | 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 | 17 beq REBOOT |
18 comb | |
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 | 21 |
2829 | 22 * NOTE: HIGHLY MACHINE DEPENDENT CODE! |
23 * THIS CODE IS SPECIFIC TO THE COCO 3! | |
24 REBOOT orcc #IntMasks turn off IRQ's | |
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 | 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 | |
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 | 41 |
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 | 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 | 49 bne Lp |
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 | 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 | 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 | 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 | 61 fcb $11,$3D,$00 |
62 Reset jmp [$FFFE] do a reset | |
63 CodeSize equ *-ReBootLoc |