Small edits to spec.
Chris Pressey
7 years ago
131 | 131 | ... |
132 | 132 | } |
133 | 133 | |
134 | The `inputs` are sometimes called the routine's READS set, while the | |
135 | `outputs` and `trashes` are collectively called the WRITES set. | |
134 | The union of the `outputs` and `trashes` is sometimes collectively called | |
135 | "the WRITES" of the routine, for historical reasons and as shorthand. | |
136 | 136 | |
137 | 137 | Routines may call only routines previously defined in the program source. |
138 | 138 | Thus, directly recursive routines are not allowed. (However, routines may |
149 | 149 | that routine is called. At the end of a routine, all memory locations listed |
150 | 150 | as outputs must be initialized. |
151 | 151 | |
152 | A routine can also be declared as "external", in which case its body need | |
153 | not be defined but an absolute address must be given for where the routine | |
154 | is located in memory. | |
152 | A literal word can given instead of the body of the routine. This word is the | |
153 | absolute address of an "external" routine located in memory but not defined by | |
154 | the SixtyPical program. | |
155 | 155 | |
156 | 156 | routine chrout |
157 | 157 | inputs a |
204 | 204 | |
205 | 205 | If and only if dest is a byte table, the index-memory-location must be given. |
206 | 206 | |
207 | ### copy ### | |
208 | ||
209 | copy <src-memory-location>, <dest-memory-location> | |
210 | ||
211 | Reads from src and writes to dest. Differs from `st` in that is able to | |
212 | copy more general types of data (for example, vectors,) and it trashes the | |
213 | `z` and `n` flags and the `a` register. | |
214 | ||
215 | * It is illegal if dest is read-only. | |
216 | * It is illegal if dest does not occur in the WRITES of the current routine. | |
217 | * It is illegal if src is not of same type as dest. | |
218 | * It is illegal if src is uninitialized. | |
219 | ||
220 | After execution, dest is considered initialized, and `z` and `n`, and | |
221 | `a` are considered uninitialized. | |
222 | ||
207 | 223 | ### add dest, src ### |
208 | 224 | |
209 | 225 | add <dest-memory-location>, <src-memory-location> |
342 | 358 | |
343 | 359 | Just before the goto, |
344 | 360 | |
345 | * It is illegal if any of the memory locations in the target executable's | |
346 | READS list is uninitialized. | |
361 | * It is illegal if any of the memory locations in the target routine's | |
362 | `inputs` list is uninitialized. | |
347 | 363 | |
348 | 364 | In addition, |
349 | 365 | |
389 | 405 | } |
390 | 406 | } until z |
391 | 407 | |
392 | "until" is optional, but if omitted, must be replaced with "forever". | |
393 | ||
394 | ### copy ### | |
395 | ||
396 | copy <src-memory-location>, <dest-memory-location> | |
397 | ||
398 | Reads from src and writes to dest. Differs from `st` in that is able to | |
399 | copy more general types of data (for example, vectors,) and it trashes the | |
400 | `z` and `n` flags and the `a` register. | |
401 | ||
402 | * It is illegal if dest is read-only. | |
403 | * It is illegal if dest does not occur in the WRITES of the current routine. | |
404 | * It is illegal if src is not of same type as dest. | |
405 | * It is illegal if src is uninitialized. | |
406 | ||
407 | After execution, dest is considered initialized, and `z` and `n`, and | |
408 | `a` are considered uninitialized. | |
408 | "until" is optional, but if omitted, must be replaced with "forever": | |
409 | ||
410 | repeat { | |
411 | cmp y, 25 | |
412 | if z { | |
413 | } | |
414 | } forever | |
415 | ||
416 | The sense of the test can be inverted with `not`. | |
417 | ||
418 | repeat { | |
419 | cmp y, 25 | |
420 | if z { | |
421 | } | |
422 | } until not z | |
409 | 423 | |
410 | 424 | Grammar |
411 | 425 | ------- |