Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sail / sh / var
1 ;
2 ; var.sh
3 ;
4 ; Variable handling
5 ;
6 ; © 1995 Straylight
7 ;
8
9 ;----- Overview -------------------------------------------------------------
10 ;
11 ; Functions provided:
12 ;
13 ; var_create
14 ; var_find
15
16 [ :LNOT::DEF:var__dfn
17 GBLL var__dfn
18
19 ; --- var_create ---
20 ;
21 ; On entry: R0 == type of variable
22 ; R1 == pointer to variable name
23 ; R2 == file address of label or DEF
24 ; R3 == line number of label or DEF
25 ; R12 == pointer to the anchor block
26 ;
27 ; On exit: R0 == pointer to the variable
28 ; May return an error
29 ;
30 ; Use: Tries to find the variable given, and return a pointer
31 ; to it if it is found. Otherwise it will try to create the
32 ; variable and return a pointer to the new one.
33
34 IMPORT var_create
35
36 ; --- var_find ---
37 ;
38 ; On entry: R0 == type of the variable
39 ; R1 == name of the variable
40 ;
41 ; On exit: CS if the variable was found, and
42 ; R0 == pointer to the variable block
43 ; CC otherwise
44 ;
45 ; Use: Tries to find the given variable in the current tree.
46
47 IMPORT var_find
48
49 ;----- Workspace ------------------------------------------------------------
50
51 ; --- Variable types ---
52
53 ^ 0
54 vType_integer # 1 ;Integer
55 vType_string # 1 ;String
56 vType_dimInt # 1 ;DIM of integers
57 vType_dimStr # 1 ;DIM of strings
58 vType_label # 1 ;Label
59 vType_proc # 1 ;Procedure name
60 vType_fn # 1 ;Function name
61
62 ; --- Lvalue types ---
63
64 vType_lvInt # 1 ;Integer variable lvalue
65 vType_lvString # 1 ;String variable lvalue
66 vType_lvWord # 1 ;Word lvalue (from `!' op)
67 vType_lvByte # 1 ;Byte lvalue (from `?' op)
68 vType_lvBytes # 1 ;String lvalue (from `$' op)
69 vType_lvIntArr # 1 ;Integer array lvalue
70 vType_lvStrArr # 1 ;String array lvalue
71
72 ]
73
74 ;----- That's all, folks ----------------------------------------------------
75
76 END