mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-11-25 07:32:16 +00:00
Small reorganization of example programs.
This commit is contained in:
parent
70ba40bf3e
commit
5d01820bb1
@ -1,7 +1,8 @@
|
|||||||
This directory contains example sources which demonstrate
|
This directory contains example sources which demonstrate
|
||||||
the rudiments of SixtyPical.
|
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
|
They are not meant to be specific to any architecture, but
|
||||||
many do assume the existence of a routine at 65490 which
|
many do assume the existence of a routine at 65490 which
|
||||||
|
4
eg/rudiments/errorful/README.md
Normal file
4
eg/rudiments/errorful/README.md
Normal 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.
|
@ -3,6 +3,14 @@
|
|||||||
// Prints "AABAB".
|
// 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
|
vector routine
|
||||||
trashes a, z, n
|
trashes a, z, n
|
||||||
print
|
print
|
||||||
@ -49,10 +57,8 @@ define main routine
|
|||||||
copy printb, vectors + x
|
copy printb, vectors + x
|
||||||
|
|
||||||
ld x, 0
|
ld x, 0
|
||||||
repeat {
|
for x up to 4 {
|
||||||
copy vectors + x, print
|
copy vectors + x, print
|
||||||
call print
|
call print
|
||||||
inc x
|
}
|
||||||
cmp x, 5
|
|
||||||
} until z
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user