Merge pull request #383 from asarhaddon/ada2tco-do
[jackhill/mal.git] / basic / variables.txt
CommitLineData
cc9dbd92
JM
1Global Unique:
2
3Z% : boxed memory values
f9f1cec9
JM
4Z1 : Z% size
5Z2 : S$ size
6Z3 : stack start address (cbm) or X% size (qbasic)
7Z4 : release stack start address (cbm) or Y% size (qbasic)
cc9dbd92
JM
8ZI : start of unused memory (index into Z%)
9ZK : start of free list (index into Z%)
bbab5c5d 10ZT : top of memory after repl env allocations
cc9dbd92
JM
11
12S$ : string memory storage
bbab5c5d 13S : next free index in S$
cc9dbd92 14
bbab5c5d
JM
15X% : logic/call stack (Z% indexes)
16X : top element of X% stack
cc9dbd92 17
bbab5c5d
JM
18Y% : pending release stack [index into Z%, eval level]
19Y : top element of Y% stack
cc9dbd92 20
bbab5c5d 21D : root repl environment
cc9dbd92 22
f9f1cec9 23BT : begin time (TI)
cc9dbd92 24ER : error type (-2: none, -1: string, >=0: object)
c756af81 25E$ : error string (ER=-1)
037815e0 26EZ : READLINE EOF return, READ_FILE EOF temp
cc9dbd92
JM
27
28LV : EVAL stack call level/depth
29
0e508fa5
JM
30RI : reader current string position
31RJ : READ_TOKEN current character index
bbab5c5d
JM
32
33
cc9dbd92
JM
34Calling arguments/temporaries:
35
c756af81
JM
36A : common call argument (especially EVAL, EVAL_AST)
37A$ : common call argument (READLINE, reader, string temp, key value)
38B : common call argument
0198b7a2 39B$ : STRING arg (HASHMAP_GET temp), PR_STR_SEQ separator
037815e0 40 : INIT_CORE_SET_FUNCTION, ENV_SET_S, ASSOC1_S
f9f1cec9 41C : common call argument, DO_TCO_FUNCTION temp in DO_APPLY
cc9dbd92
JM
42E : environment (EVAL, EVAL_AST)
43F : function
44H : hash map
45K : hash map key (Z% index)
a742287e
JM
46L : ALLOC* Z%(R,1) default
47M : ALLOC* Z%(R+1,0) default
48N : ALLOC* Z%(R+1,1) default
cc9dbd92 49R : common return value
c756af81
JM
50R$ : common string return value
51T : type arg, common temp
93593012 52Q : PUSH*, POP*, PEEK* return value (and PEEK_Q_Q call arg)
cc9dbd92 53
f9f1cec9 54AR : APPLY, DO_*_FUNCTION arg list
c756af81
JM
55AY : RELEASE/FREE arg
56AZ : PR_STR arg
e0bcd3fb
JM
57P1 : PR_MEMORY*, PR_OBJECT, CHECK_FREE_LIST start
58P2 : PR_MEMORY*, PR_OBJECT, CHECK_FREE_LIST end
d7a6c2d6 59P3 : PR_OBJECT, PR_MEMORY_VALUE
f9f1cec9
JM
60R1 : REP, RE - MAL_READ result temp
61R2 : REP, RE - EVAL result temp
9d59cdb3 62R3 : HASHMAP_GET, DO_HASH_MAP, DO_KEYS_VALS temp and return value
f9f1cec9
JM
63R4 : ENV_FIND temp and return value
64R6 : SLICE return value (last element)
cc9dbd92 65SZ : size argument to ALLOC
c756af81
JM
66S1$ : REPLACE needle
67S2$ : REPLACE replacement
cc9dbd92 68
f9f1cec9 69
c756af81 70Other temporaries:
f9f1cec9 71
0e508fa5 72A0 : EVAL ast elements
4202ef7b
JM
73A1 : EVAL ast elements, DO_FUNCTION temp
74A2 : EVAL ast elements, DO_FUNCTION temp
0e508fa5 75A3 : EVAL ast elements
4202ef7b 76B1 : DO_FUNCTION temp
01e8850d 77
c756af81 78CZ : DO_CONCAT stack position
01e8850d
JM
79ED : EQUAL_Q recursion depth counter
80RD : PR_OBJECT recursion depth
81SD : READ_STR sequence read recursion depth
82
4fab6aa5 83C$ : READ_TOKEN, SKIP_SPACES, SKIP_TO_EOL current character
e0bcd3fb 84D$ : READ_TOKEN/READ_FILE_CHAR temp
d7a6c2d6
JM
85G : function value ON GOTO switch flag, EVAL_AST changed flag
86I : STRING, REPLACE, SLICE, PR_MEMORY, PR_OBJECT, PR_MEMORY_VALUE
87J : REPLACE, PR_MEMORY_VALUE
f9f1cec9 88U : ALLOC, RELEASE, PR_STR temp
037815e0 89V : RELEASE, PR_STR_SEQ temp
9d59cdb3 90W : SLICE, LAST, QUASIQUOTE, DO_HASH_MAP, DO_KEYS_VALS, step2-3 EVAL temp
e0bcd3fb 91P : PR_MEMORY_SUMMARY_SMALL
f9f1cec9
JM
92RC : RELEASE remaining number of elements to release
93RF : reader reading from file flag
0e508fa5
JM
94S1 : READ_TOKEN in a string?
95S2 : READ_TOKEN escaped?
96T$ : READ_* current token string
037815e0 97T1 : EQUAL_Q, PR_STR, DO_KEYS_VALS temp
c756af81 98T2 : EQUAL_Q, DO_KEY_VALS, HASH_MAP_GET
c756af81 99T3$ : REPLACE temp
f9f1cec9 100
cc9dbd92
JM
101
102Unused:
103
f9f1cec9
JM
104O
105
106
107Counting number of times each variable is assigned:
108 sed 's/:/\n /g' readline.in.bas types.in.bas reader.in.bas printer.in.bas env.in.bas core.in.bas stepA_mal.in.bas | grep "[A-Z][A-Z0-9]*[%$]*=" | sed 's/.*[^A-Z]\([A-Z][A-Z0-9]*[%$]*\)=.*/\1/g' | sort | uniq -c | sort -n
109