git @ Cat's Eye Technologies SixtyPical / 398b67c
Yet more TODO notes. Chris Pressey 4 years ago
1 changed file(s) with 32 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
8585 It might make more sense, then, for it to be "part of the operation" instead of "part of
8686 the reference"; something like `st.hi x, word`; `st.lo y, word`. Dunno.
8787
88 ### Save registers on stack
88 ### Save values
8989
9090 This preserves them, so that, semantically, they can be used later even though they
91 are trashed inside the block.
91 are trashed (or otherwise alternately used) inside the block.
92
93 Inside the block, we set them as writeable (but not meaningful). When the block
94 exits, we restore whatever status they had.
95
96 This act will trash `a`, both in the block, and outside it, unless the value being
97 saved is `a`. One idiom would be something like
98
99 save a { save var {
100 ...
101 } }
102
103 which would save all values. Maybe abbreviate this to
104
105 save a, var {
106 ...
107 }
108
109 This can use the stack. But it need not use the stack.
110
111 ### Make all symbols forward-referencable
112
113 Basically, don't do symbol-table lookups when parsing, but do have a more formal
114 "symbol resolution" (linking) phase right after parsing.
92115
93116 ### Associate each pointer with the buffer it points into
94117
102125
103126 When we read through the pointer, we need to check that the buffer is readable.
104127
105 ### table overlays
128 ### Table overlays
106129
107130 They are uninitialized, but the twist is, the address is a buffer that is
108131 an input to and/or output of the routine. So, they are defined (insofar
126149
127150 Question the value of the "consistent initialization" principle for `if` statement analysis.
128151
152 Part of this is the trashes at the end; I think what it should be is that the trashes
153 after the `if` is the union of the trashes in each of the branches; this would obviate the
154 need to `trash` values explicitly, but if you tried to access them afterwards, it would still
155 error.
156
129157 ### Tail-call optimization
130158
131159 More generally, define a block as having zero or one `goto`s at the end. (and `goto`s cannot
137165 And - once we have this - why do we need `goto` to be in tail position, strictly?
138166 As long as the routine has consistent type context every place it exits, that should be fine.
139167
140 ### Include pragmas
168 ### "Include" directives
141169
142170 Search a searchlist of include paths. And use them to make libraries of routines.
143171