From 646ec38aa8494e39a640f17e800c34eed003a7bf Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Wed, 21 Oct 2015 19:14:59 +0100 Subject: [PATCH] Spec `goto`. --- doc/SixtyPical.md | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/doc/SixtyPical.md b/doc/SixtyPical.md index b21770d..4e65a4b 100644 --- a/doc/SixtyPical.md +++ b/doc/SixtyPical.md @@ -291,11 +291,12 @@ current routine, and it continues to be initialized afterwards. Transfers execution to the given executable, whether that is a previously- defined routine, or a vector location which contains the address of a routine -which will be called indirectly. +which will be called indirectly. Execution will be transferred back to the +current routine, when execution of the executable is finished. Just before the call, -* It is illegal if any of the memory locations in the called routine's +* It is illegal if any of the memory locations in the target executable's READS list is uninitialized. Just after the call, @@ -305,6 +306,28 @@ Just after the call, * All memory locations listed as TRASHED in the called routine's OUTPUTS list are considered initialized. +### goto ### + + goto + +Unilaterally transfers execution to the given executable. Execution will not +be transferred back to the current routine when execution of the executable is +finished; rather, it will be transferred back to the caller of the current +routine. + +If `goto` is used in a routine, it must be in tail position. That is, it +must be the final instruction in the routine. + +Just before the goto, + +* It is illegal if any of the memory locations in the target executable's + READS list is uninitialized. + +In addition, + +* The target executable's WRITES lists must not include any locations + that are not already included in the current routine's WRITES lists. + ### if ### if { @@ -363,10 +386,6 @@ copy more general types of data (for example, vectors,) and it trashes the After execution, dest is considered initialized, and `z` and `n`, and `a` are considered uninitialized. -### goto ### - -TBW - Grammar -------