1: /
2: /
3:
4: / f13 -- dimension and array declarator
5: /
6: / dimension
7: /
8: /
9: .globl sdime
10: .globl sdime1
11:
12: .globl getsym
13: .globl error
14: .globl geti
15: .globl dimu
16:
17: sdime:
18: jsr r5,getsym
19: tst r0
20: bne 3f / junk error
21: mov r3,-(sp)
22: jsr r5,getsym
23: mov (sp)+,r3
24: cmp r0,$32. / (
25: beq 2f
26: jsr r5,error; 4. / no ( in dimension
27: rts r5
28: 2:
29: jsr r5,sdime1
30: jsr r5,getsym
31: cmp r0,$36. / ,
32: beq sdime
33: cmp r0,$40.
34: beq 1f
35: 3:
36: jsr r5,error; 5.
37: 1:
38: rts r5
39:
40: / get dimension info and store in
41: / symbol table entry
42: / r3 points at symbol table
43: / r1 points just beyond (
44: sdime1:
45: bit $70,symtab(r3) / class
46: beq 1f
47: jsr r5,error; 6. / already classed
48: 1:
49: mov r3,-(sp)
50: bic $70,symtab(r3)
51: bis $20,symtab(r3) / set as array
52: clr -(sp) / marker
53: 1:
54: jsr r5,getsym
55: cmp r0,$2 / constant
56: bne 2f
57: cmp r3,$intcon / integer*4
58: bne 3f
59: jsr r5,geti
60: tst r0
61: ble 3f
62: mov r0,-(sp)
63: br 4f
64: 2:
65: tst r0
66: bne 3f / identifer
67: tstb symtab(r3)
68: bge 3f / not parameter
69: neg r3
70: mov r3,-(sp)
71: mov sp,r0
72: 2:
73: tst (r0)+
74: bne 2b
75: mov (r0),r0
76: tstb symtab(r0)
77: bge 3f / array not a param
78: 4:
79: jsr r5,getsym
80: cmp r0,$36. / ,
81: beq 1b
82: cmp r0,$34. / )
83: beq 1f
84: 3:
85: jsr r5,error; 7.
86: 1:
87: mov esymp,r0
88: clr r2
89: mov dimu,-(r0)
90: inc dimu / unique number
91: 1:
92: inc r2
93: mov (sp)+,-(r0)
94: bne 1b
95: dec r2
96: mov r2,(r0)
97: mov r0,esymp
98: mov (sp)+,r3
99: mov r0,symtab+2(r3)
100: rts r5
Defined functions
sdime
declared in line
9; defined in line
17; used 4 times
sdime1
declared in line
10; defined in line
44; used 6 times