diff --git a/eg/rudiments/README.md b/eg/rudiments/README.md index 51230f4..0567477 100644 --- a/eg/rudiments/README.md +++ b/eg/rudiments/README.md @@ -1,7 +1,8 @@ This directory contains example sources which demonstrate the rudiments of SixtyPical. -Some are meant to fail and produce an error message. +Examples that are meant to fail and produce an error message +are in the `errorful/` subdirectory. They are not meant to be specific to any architecture, but many do assume the existence of a routine at 65490 which diff --git a/eg/rudiments/errorful/README.md b/eg/rudiments/errorful/README.md new file mode 100644 index 0000000..e5b307a --- /dev/null +++ b/eg/rudiments/errorful/README.md @@ -0,0 +1,4 @@ +This directory contains example SixtyPical sources which +are intentionally invalid (for demonstration purposes) +and are expected to elicit an error message from a +SixtyPical implementation. diff --git a/eg/rudiments/add-fail.60p b/eg/rudiments/errorful/add.60p similarity index 100% rename from eg/rudiments/add-fail.60p rename to eg/rudiments/errorful/add.60p diff --git a/eg/rudiments/range-error.60p b/eg/rudiments/errorful/range.60p similarity index 100% rename from eg/rudiments/range-error.60p rename to eg/rudiments/errorful/range.60p diff --git a/eg/rudiments/bad-vector.60p b/eg/rudiments/errorful/vector.60p similarity index 100% rename from eg/rudiments/bad-vector.60p rename to eg/rudiments/errorful/vector.60p diff --git a/eg/rudiments/vector-table.60p b/eg/rudiments/vector-table.60p index 4362012..b6cce2a 100644 --- a/eg/rudiments/vector-table.60p +++ b/eg/rudiments/vector-table.60p @@ -3,6 +3,14 @@ // Prints "AABAB". // +// TODO: this doesn't pass the analyzer currently, which suggests a bug. +// +// RangeExceededError: Possible range of x:byte (0, 255) exceeds +// acceptable range of vectors:vector table[32] (0, 31) (in main, line 57) +// +// (despite various attempts to work around by calling a setup routine, etc.) +// It should really be able to figure out that the range of x is 0..4 there. + vector routine trashes a, z, n print @@ -49,10 +57,8 @@ define main routine copy printb, vectors + x ld x, 0 - repeat { + for x up to 4 { copy vectors + x, print call print - inc x - cmp x, 5 - } until z + } }