1: / Startup code for standalone utilities
2: / wfj- mod's to allow non sep i/d machines, error recovery
3: / note that the bootstrap passes the cputype through in
4: / r0.
5:
6: / non-UNIX instructions
7: mfpi = 6500^tst
8: stst = 170300^tst
9: mtpi = 6600^tst
10: mfpd = 106500^tst
11: mtpd = 106600^tst
12: spl = 230
13: ldfps = 170100^tst
14: stfps = 170200^tst
15: wait = 1
16: rtt = 6
17: reset = 5
18: / trap = 104400
19:
20: PS = 177776
21:
22: .globl _end
23: .globl _main, __rtt
24: .globl _edata
25: jmp start
26:
27: /
28: / trap vectors
29: /
30: trap;340 / bus error
31: trap;341 / illegal instruction
32: trap;342 / BPT
33: trap;343 / IOT
34: trap;344 / POWER FAIL
35: trap;345 / EMT
36: tvec:
37: start;346 / TRAP
38: .=400^.
39: .text
40:
41:
42: start:
43: mov $340,*$PS
44: mov $trap,tvec
45: /
46: / restore what kind of cpu we are running on
47: mov r0,*$_cputype / assume that the boot left this in r0
48: / check if there is a switch register
49: mov $1f,nofault
50: tst CSW
51: incb _haveCSW
52: 1:
53: clr nofault
54: mov $157776,sp
55: mov $_edata,r0
56: mov $_end,r1
57: sub r0,r1
58: inc r1
59: clc
60: ror r1
61: 1:
62: clr (r0)+
63: sob r1,1b
64: jsr pc,_main
65:
66: / fix up stack to point at trap ps-pc pair,
67: / located at bottom of memory.
68: / so we can return to the bootstrap
69:
70: __rtt:
71: mov $140000,sp
72: rtt / we hope!
73: br .
74:
75:
76: .globl _trap
77: trap:
78: mov *$PS,-(sp)
79: mov r0,-(sp)
80: mov r1,-(sp)
81: tst nofault
82: bne 3f
83: 2: jsr pc,_trap
84: mov (sp)+,r1
85: mov (sp)+,r0
86: tst (sp)+
87: rtt
88: 3: mov (sp)+,r1
89: mov (sp)+,r0
90: tst (sp)+
91: mov nofault,(sp)
92: rtt
93:
94: .data
95: .globl _cputype, _haveCSW
96:
97: nofault: .=.+2 / where to go on predicted trap
98: _cputype: .=.+2 / cpu type (currently 24,40,45 or 70)
99: _haveCSW: .=.+1 / one if there is a switch register
100: KISA6 = 172354
101: KISA7 = 172356
102: KDSA6 = 172374
103: UBMAP = 170200
104: CSW = 177570
Defined functions
PS
defined in line
20; used 2 times
__rtt
declared in line
23; defined in line
70; used 1 times
start
defined in line
42; used 2 times
trap
defined in line
77; used 7 times
tvec
defined in line
36; used 1 times
Defined variables
CSW
defined in line
104; used 1 times
_cputype
declared in line
95; defined in line
98; used 2 times
_haveCSW
declared in line
95; defined in line
99; used 2 times