chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sail / sh / tree
1 ;
2 ; tree.sh
3 ;
4 ; Another attempt at symbol table management
5 ;
6 ; © 1995 Straylight
7 ;
8
9 ;----- Overview -------------------------------------------------------------
10 ;
11 ; Functions provided:
12 ;
13 ;  tree_add
14 ;  tree_find
15 ;  str_cmp
16
17                 [       :LNOT::DEF:tree__dfn
18                 GBLL    tree__dfn
19
20 ; --- tree_add ---
21 ;
22 ; On entry:     R0 == type number
23 ;               R1 == address of name
24 ;               R2 == size of user data
25 ;
26 ; On exit:      R0 == address of user data in new node
27 ;               CS if node already exists, else CC
28 ;               May return an error
29 ;
30 ; Use:          Adds a node into a symbol table tree.
31
32                 IMPORT  tree_add
33
34 ; --- tree_find ---
35 ;
36 ; On entry:     R0 == type number
37 ;               R1 == pointer to the name
38 ;
39 ; On exit:      CS if the variable was found, and
40 ;                 R0 == pointer to the variable block
41 ;               else CC and
42 ;                 R0 corrupted
43 ;
44 ; Use:          Tries to find a node with the given type and name in
45 ;               the symbol tree.
46
47                 IMPORT  tree_find
48
49 ; --- str_cmp ---
50 ;
51 ; On entry:     R0 == pointer to string A
52 ;               R1 == pointer to string B
53 ;
54 ; On exit:      Flags as appropriate
55 ;
56 ; Use:          Case-sensitively compares two strings.  You can use the
57 ;               normal ARM condition codes after the compare, so you can
58 ;               treat this fairly much like a normal CMP.
59
60                 IMPORT  str_cmp
61
62                 ]
63
64 ;----- That's all, folks ----------------------------------------------------
65
66                 END