From 0b96db3afbecb9444dd5abf1f8564a3e4176484f Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Tue, 2 Jul 2019 15:17:41 -0700 Subject: [PATCH] A few changes to labels and VTabs as I write the interpreter. --- rational.md | 3 +++ reference.md | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/rational.md b/rational.md index 501e4aa..e2c5156 100644 --- a/rational.md +++ b/rational.md @@ -22,6 +22,9 @@ program. Does it terminate or infinitely loop? [Space] [Tab] [LF] +[LF] +[Space] +[Space] [VTab] [Space] [Tab] diff --git a/reference.md b/reference.md index c5c4344..411605c 100644 --- a/reference.md +++ b/reference.md @@ -42,13 +42,13 @@ representation. [Space] [Tab][Space][Tab][Space][Tab][Space] [LF] -Labels consist of an opening [VTab] followed by a [LF] terminated list of up -to sixteen spaces and tabs. There is only one global namespace so all labels -must be unique. Labels are left-padded with [Space] up to sixteen characters; -the following two labels are interchangeable. +Labels consist of an [LF] terminated list of up to sixteen spaces and tabs. The +program must not begin with a label. There is only one global namespace so all +labels must be unique. Labels are left-padded with [Space] up to sixteen +characters; the following two labels are interchangeable. - [VTab] [Tab][Space][Tab] [LF] - [VTab] [Space][Tab][Space][Tab] [LF] + [Tab][Space][Tab] [LF] + [Space][Tab][Space][Tab] [LF] ## Stack Manipulation (IMP: [Space]) ## @@ -96,15 +96,15 @@ well as the targets of conditional and unconditional jumps, by which loops can be implemented. Programs must be ended by means of [LF][LF][LF] so that the interpreter can exit cleanly. -| Command | Params | Meaning | -| :------------- | :----- | :------------------------------- | -| [Space][Space] | Label | Mark a location in the program | -| [Space][Tab] | Label | Call a subroutine | -| [Space][LF] | Label | Jump unconditionally to a label | -| [Tab][Space] | Label | Jump to label if TOS is zero | -| [Tab][Tab] | Label | Jump to label if TOS is negative | -| [Tab][LF] | --- | Return from subroutine | -| [LF][LF] | --- | End the program | +| Command | Params | Meaning | +| :------------------- | :----- | :------------------------------- | +| [Space][Space][VTab] | Label | Mark a location in the program | +| [Space][Tab] | Label | Call a subroutine | +| [Space][LF] | Label | Jump unconditionally to a label | +| [Tab][Space] | Label | Jump to label if TOS is zero | +| [Tab][Tab] | Label | Jump to label if TOS is negative | +| [Tab][LF] | --- | Return from subroutine | +| [LF][LF] | --- | End the program | ## I/O (IMP: [Tab][LF]) ## -- 2.20.1