git @ Cat's Eye Technologies SixtyPical / c79bc56
Small edits to spec. Chris Pressey 7 years ago
1 changed file(s) with 38 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
131131 ...
132132 }
133133
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.
136136
137137 Routines may call only routines previously defined in the program source.
138138 Thus, directly recursive routines are not allowed. (However, routines may
149149 that routine is called. At the end of a routine, all memory locations listed
150150 as outputs must be initialized.
151151
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.
155155
156156 routine chrout
157157 inputs a
204204
205205 If and only if dest is a byte table, the index-memory-location must be given.
206206
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
207223 ### add dest, src ###
208224
209225 add <dest-memory-location>, <src-memory-location>
342358
343359 Just before the goto,
344360
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.
347363
348364 In addition,
349365
389405 }
390406 } until z
391407
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
409423
410424 Grammar
411425 -------