1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-15 14:29:32 +00:00

Small reorganization of example programs.

This commit is contained in:
Chris Pressey 2018-12-11 17:17:15 +00:00
parent 70ba40bf3e
commit 5d01820bb1
6 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -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.

View File

@ -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
}
}