1: /* @(#)mcrt0.s 2.1 SCCS id keyword */
2: / C runtime startoff including monitoring
3:
4: cbufs = 300.
5: exit = 1
6: write = 4
7:
8: .globl _monitor
9: .globl _sbrk
10: .globl _main
11: .globl _exit
12: .globl _environ
13: .globl _etext
14: .globl __cleanup
15: .globl countbase
16:
17:
18: start:
19: setd
20: mov 2(sp),r0
21: clr -2(r0)
22: mov sp,r0
23: sub $4,sp
24: mov 4(sp),(sp)
25: tst (r0)+
26: mov r0,2(sp)
27: 1:
28: tst (r0)+
29: bne 1b
30: cmp r0,*2(sp)
31: blo 1f
32: tst -(r0)
33: 1:
34: mov r0,4(sp)
35: mov r0,_environ
36:
37: mov $_etext,r1
38: sub $eprol,r1
39: add $7,r1
40: ash $-3,r1
41: bic $!17777,r1
42: mov $cbufs,-(sp)
43: add $3*[cbufs+1],r1
44: mov r1,-(sp)
45: asl r1
46: mov r1,-(sp)
47: jsr pc,_sbrk
48: tst (sp)+
49: cmp r0,$-1
50: beq 9f
51: mov r0,-(sp)
52: add $6,r0
53: mov r0,countbase
54: mov $_etext,-(sp)
55: mov $eprol,-(sp)
56: jsr pc,_monitor
57: add $10.,sp
58: jsr pc,_main
59: cmp (sp)+,(sp)+
60: mov r0,(sp)
61: jsr pc,_exit
62:
63: 9:
64: mov $2,r0
65: sys write; 8f; 9f-8f
66:
67: .data; 8: <No space for monitor buffer\n>; 9:.even; .text
68:
69: _exit:
70: mov r5,-(sp)
71: mov sp,r5
72: jsr pc,__cleanup
73: clr -(sp)
74: jsr pc,_monitor
75: tst (sp)+
76: mov 4(r5),r0
77: sys exit
78: eprol:
79: .bss
80: _environ:
81: .=.+2
82: countbase:
83: .=.+2
84: .data
85: .=.+2
Defined functions
_exit
declared in line
11; defined in line
69; used 2 times
cbufs
defined in line
4; used 2 times
eprol
defined in line
78; used 2 times
exit
defined in line
5; used 1 times
start
defined in line
18;
never used
write
defined in line
6; used 1 times
Defined variables
_environ
declared in line
12; defined in line
80; used 2 times