32 | 32 |
| {
|
33 | 33 |
| ld a, 0
|
34 | 34 |
| }
|
35 | |
? UsageClashError: a
|
|
35 |
? InconsistentConstraintsError: a
|
36 | 36 |
|
37 | 37 |
If a routine declares it outputs a location, that location should be initialized.
|
38 | 38 |
|
|
41 | 41 |
| {
|
42 | 42 |
| ld x, 0
|
43 | 43 |
| }
|
44 | |
? UninitializedOutputError: a
|
|
44 |
? UnmeaningfulOutputError: a in main
|
45 | 45 |
|
46 | 46 |
| routine main
|
47 | 47 |
| inputs a
|
|
106 | 106 |
| {
|
107 | 107 |
| ld a, x
|
108 | 108 |
| }
|
109 | |
? UninitializedAccessError: x
|
|
109 |
? UnmeaningfulReadError: x in main
|
110 | 110 |
|
111 | 111 |
Can't `ld` to a memory location that doesn't appear in (outputs ∪ trashes).
|
112 | 112 |
|
|
138 | 138 |
| {
|
139 | 139 |
| ld a, 0
|
140 | 140 |
| }
|
141 | |
? IllegalWriteError: a
|
|
141 |
? ForbiddenWriteError: a in main
|
142 | 142 |
|
143 | 143 |
| routine main
|
144 | 144 |
| trashes a, n
|
145 | 145 |
| {
|
146 | 146 |
| ld a, 0
|
147 | 147 |
| }
|
148 | |
? IllegalWriteError: z
|
|
148 |
? ForbiddenWriteError: z in main
|
149 | 149 |
|
150 | 150 |
### st ###
|
151 | 151 |
|
|
166 | 166 |
| {
|
167 | 167 |
| st x, lives
|
168 | 168 |
| }
|
169 | |
? UninitializedAccessError: x
|
|
169 |
? UnmeaningfulReadError: x in main
|
170 | 170 |
|
171 | 171 |
Can't `st` to a memory location that doesn't appear in (outputs ∪ trashes).
|
172 | 172 |
|
|
192 | 192 |
| {
|
193 | 193 |
| st 0, lives
|
194 | 194 |
| }
|
195 | |
? IllegalWriteError: lives
|
|
195 |
? ForbiddenWriteError: lives in main
|
196 | 196 |
|
197 | 197 |
Storing to a table, you must use an index, and vice-versa.
|
198 | 198 |
|
|
1249 | 1249 |
|
1250 | 1250 |
Jumping through the vector does indeed output the things the vector says it does.
|
1251 | 1251 |
|
1252 | |
> | vector foo trashes a, x, z, n
|
1253 | |
> |
|
1254 | |
> | routine bar trashes a, x, z, n {
|
1255 | |
> | ld x, 200
|
1256 | |
> | }
|
1257 | |
> |
|
1258 | |
> | routine sub inputs bar trashes foo, a, x, z, n {
|
1259 | |
> | ld x, 0
|
1260 | |
> | copy bar, foo
|
1261 | |
> | goto foo
|
1262 | |
> | }
|
1263 | |
> |
|
1264 | |
> | routine main inputs bar outputs a trashes z, n {
|
1265 | |
> | call sub
|
1266 | |
> | ld a, x
|
1267 | |
> | }
|
1268 | |
> ? UnmeaningfulReadError: x in main
|
|
1252 |
| vector foo trashes a, x, z, n
|
|
1253 |
|
|
|
1254 |
| routine bar trashes a, x, z, n {
|
|
1255 |
| ld x, 200
|
|
1256 |
| }
|
|
1257 |
|
|
|
1258 |
| routine sub inputs bar trashes foo, a, x, z, n {
|
|
1259 |
| ld x, 0
|
|
1260 |
| copy bar, foo
|
|
1261 |
| goto foo
|
|
1262 |
| }
|
|
1263 |
|
|
|
1264 |
| routine main inputs bar outputs a trashes z, n {
|
|
1265 |
| call sub
|
|
1266 |
| ld a, x
|
|
1267 |
| }
|
|
1268 |
? UnmeaningfulReadError: x in main
|
1269 | 1269 |
|
1270 | 1270 |
Ack, I have become a bit confused...
|