1: /
2: /
3:
4: / fx1 -- utility
5:
6: .globl lookup
7: / lookup
8: / lookup string pointed at by r2
9: / in table pointed at by arg1
10: / r0 returns symbol number*2
11: / r2 is advanced by matched string
12: / registers used: r0,r2
13: lookup:
14: mov r1,-(sp)
15: clr r0
16: mov r2,-(sp)
17: mov (r5)+,r1
18: 1:
19: mov (sp),r2
20: tstb (r1)
21: beq 1f
22: 2:
23: cmpb (r2)+,(r1)+
24: bne 2f
25: tstb (r1)
26: bne 2b
27: asl r0
28: cmp (r5)+,(sp)+
29: mov (sp)+,r1
30: rts r5
31: 2:
32: tstb (r1)+
33: bne 2b
34: inc r0
35: br 1b
36: 1:
37: mov (sp)+,r2
38: mov (sp)+,r1
39: rts r5
Defined functions
lookup
declared in line
6; defined in line
13; used 7 times