diff --git a/eg/vector-table.60p b/eg/vector-table.60p new file mode 100644 index 0000000..2ffb666 --- /dev/null +++ b/eg/vector-table.60p @@ -0,0 +1,53 @@ +vector routine + trashes a, z, n + print + +vector (routine + trashes a, z, n) + table[32] vectors + +routine chrout + inputs a + trashes a + @ 65490 + +routine printa + trashes a, z, n +{ + ld a, 65 + call chrout +} + +routine printb + trashes a, z, n +{ + ld a, 66 + call chrout +} + +routine main + inputs vectors + outputs vectors + trashes print, a, x, z, n, c +{ + ld x, 0 + copy printa, vectors + x + inc x + copy printa, vectors + x + inc x + copy printb, vectors + x + inc x + copy printa, vectors + x + inc x + copy printb, vectors + x + + copy printa, print + + ld x, 0 + repeat { + copy vectors + x, print + call print + inc x + cmp x, 5 + } until z +} diff --git a/eg/vector.60p b/eg/vector.60p index 0fa1d6c..fd86d93 100644 --- a/eg/vector.60p +++ b/eg/vector.60p @@ -1,5 +1,6 @@ -vector print +vector routine trashes a, z, n + print routine chrout inputs a @@ -21,7 +22,6 @@ routine printb } routine main - inputs printa, printb trashes print, a, z, n { copy printa, print