git @ Cat's Eye Technologies SixtyPical / 38119db
Convert all tests to new syntax. Chris Pressey 3 years ago
1 changed file(s) with 62 addition(s) and 62 deletion(s). Raw diff Collapse all Expand all
1212
1313 Null program.
1414
15 | routine main
15 | define main routine
1616 | {
1717 | }
1818 = $080D RTS
1919
2020 `nop` program.
2121
22 | routine main
22 | define main routine
2323 | {
2424 | nop
2525 | }
2828
2929 Rudimentary program.
3030
31 | routine main
31 | define main routine
3232 | inputs a
3333 | outputs a
3434 | trashes c, z, n, v
4242
4343 Call extern.
4444
45 | routine chrout
45 | define chrout routine
4646 | inputs a
4747 | trashes a
4848 | @ 65490
4949 |
50 | routine main
50 | define main routine
5151 | inputs a
5252 | trashes a, z, n
5353 | {
6060
6161 Call defined routine.
6262
63 | routine foo
63 | define foo routine
6464 | outputs a, x, y
6565 | trashes z, n
6666 | {
6969 | ld y, 0
7070 | }
7171 |
72 | routine main
72 | define main routine
7373 | trashes a, x, y, z, n
7474 | {
7575 | call foo
8585
8686 | byte foo
8787 |
88 | routine main
88 | define main routine
8989 | trashes a, y, z, n, foo
9090 | {
9191 | ld y, 0
101101
102102 | byte screen @ 1024
103103 |
104 | routine main
104 | define main routine
105105 | trashes a, z, n, screen
106106 | {
107107 | ld a, 100
117117 | byte zp @ $00
118118 | byte screen @ 100
119119 |
120 | routine main
120 | define main routine
121121 | inputs screen, zp
122122 | outputs screen, zp
123123 | trashes a, z, n
143143
144144 | byte lives : 3
145145 |
146 | routine main
146 | define main routine
147147 | inputs lives
148148 | trashes a, z, n
149149 | {
158158 | word w1 @ 60001
159159 | word w2 : 3003
160160 |
161 | routine main
161 | define main routine
162162 | inputs w1
163163 | outputs w2
164164 | trashes a, z, n
177177
178178 | byte table[8] message : "WHAT?"
179179 |
180 | routine main
180 | define main routine
181181 | inputs message
182182 | outputs x, a, z, n
183183 | {
199199
200200 | byte table[8] message : 255, 0, 129, 128, 127
201201 |
202 | routine main
202 | define main routine
203203 | inputs message
204204 | outputs x, a, z, n
205205 | {
221221
222222 | word table[4] message : 65535, 0, 127, 127
223223 |
224 | routine main
224 | define main routine
225225 | {
226226 | }
227227 = $080D RTS
238238
239239 | byte foo
240240 |
241 | routine main
241 | define main routine
242242 | trashes a, x, y, z, n, c, v, foo
243243 | {
244244 | ld a, 0
316316
317317 | byte table[256] many
318318 |
319 | routine main
319 | define main routine
320320 | inputs many
321321 | outputs many
322322 | trashes a, x, c, n, z, v
340340
341341 | byte table[256] many
342342 |
343 | routine main
343 | define main routine
344344 | inputs many
345345 | outputs many
346346 | trashes a, x, c, n, z
362362
363363 | byte table[256] many
364364 |
365 | routine main
365 | define main routine
366366 | inputs many
367367 | outputs many
368368 | trashes a, x, c, n, z
386386
387387 Compiling `if`.
388388
389 | routine main
389 | define main routine
390390 | trashes a, x, y, z, n, c, v
391391 | {
392392 | ld a, 0
405405
406406 Compiling `if not`.
407407
408 | routine main
408 | define main routine
409409 | trashes a, x, y, z, n, c, v
410410 | {
411411 | ld a, 0
424424
425425 Compiling `if` without `else`.
426426
427 | routine main
427 | define main routine
428428 | trashes a, x, y, z, n, c, v
429429 | {
430430 | ld a, 0
441441
442442 Compiling `repeat ... until z`.
443443
444 | routine main
444 | define main routine
445445 | trashes a, y, z, n, c
446446 | {
447447 | ld y, 65
460460
461461 Compiling `repeat ... until not z`.
462462
463 | routine main
463 | define main routine
464464 | trashes a, y, z, n, c
465465 | {
466466 | ld y, 65
479479
480480 Compiling `repeat ... until n`.
481481
482 | routine main
482 | define main routine
483483 | trashes a, y, z, n, c
484484 | {
485485 | ld y, 65
496496
497497 Compiling `repeat ... until not n`.
498498
499 | routine main
499 | define main routine
500500 | trashes a, y, z, n, c
501501 | {
502502 | ld y, 199
513513
514514 Compiling `repeat forever`.
515515
516 | routine main
516 | define main routine
517517 | trashes a, y, z, n, c
518518 | {
519519 | ld y, 65
528528
529529 The body of `repeat forever` can be empty.
530530
531 | routine main
531 | define main routine
532532 | {
533533 | repeat {
534534 | } forever
578578
579579 Compiling `save`.
580580
581 | routine main
581 | define main routine
582582 | inputs a
583583 | outputs a
584584 | trashes z, n
602602
603603 Compiling `save` with shortcut syntax.
604604
605 | routine main
605 | define main routine
606606 | inputs a
607607 | outputs a
608608 | trashes z, n
625625 Compiling `save` on a user-defined location.
626626
627627 | byte foo
628 | routine main
628 | define main routine
629629 | trashes a, z, n
630630 | {
631631 | save foo {
646646 | byte one
647647 | byte table[256] many
648648 |
649 | routine main
649 | define main routine
650650 | outputs many
651651 | trashes a, x, n, z
652652 | {
666666 | byte table[256] tab1
667667 | byte table[256] tab2
668668 |
669 | routine main
669 | define main routine
670670 | inputs tab1
671671 | outputs tab2
672672 | trashes a, x, n, z
685685 | byte one
686686 | byte two
687687 |
688 | routine main
688 | define main routine
689689 | outputs one, two
690690 | trashes a, x, n, z
691691 | {
703703 | byte bar
704704 | byte baz
705705 |
706 | routine main
706 | define main routine
707707 | inputs baz
708708 | outputs bar
709709 | trashes a, n, z
719719 | word bar
720720 | word baz
721721 |
722 | routine main
722 | define main routine
723723 | inputs baz
724724 | outputs bar
725725 | trashes a, n, z
736736
737737 | word bar
738738 |
739 | routine main
739 | define main routine
740740 | outputs bar
741741 | trashes a, n, z
742742 | {
752752
753753 | word table[256] many
754754 |
755 | routine main
755 | define main routine
756756 | inputs many
757757 | outputs many
758758 | trashes a, x, n, z
772772 | vector routine bar
773773 | vector routine baz
774774 |
775 | routine main
775 | define main routine
776776 | inputs baz
777777 | outputs bar
778778 | trashes a, n, z
793793 | trashes z, n
794794 | bar
795795 |
796 | routine foo
796 | define foo routine
797797 | inputs x
798798 | outputs x
799799 | trashes z, n
801801 | inc x
802802 | }
803803 |
804 | routine main
804 | define main routine
805805 | outputs bar
806806 | trashes a, n, z
807807 | {
827827 | trashes z, n
828828 | bar
829829 |
830 | routine main
830 | define main routine
831831 | outputs bar
832832 | trashes a, n, z
833833 | {
834834 | copy foo, bar
835835 | }
836836 |
837 | routine foo
837 | define foo routine
838838 | inputs x
839839 | outputs x
840840 | trashes z, n
854854 | word one
855855 | word table[256] many
856856 |
857 | routine main
857 | define main routine
858858 | inputs one, many
859859 | outputs one, many
860860 | trashes a, x, y, n, z
898898 | trashes z, n
899899 | foo
900900 |
901 | routine bar
901 | define bar routine
902902 | outputs x
903903 | trashes z, n
904904 | {
905905 | ld x, 200
906906 | }
907907 |
908 | routine main
908 | define main routine
909909 | outputs x, foo
910910 | trashes a, z, n
911911 | {
925925
926926 Compiling `goto`. Note that no `RTS` is emitted after the `JMP`.
927927
928 | routine bar
928 | define bar routine
929929 | inputs y
930930 | outputs x, y
931931 | trashes z, n
933933 | ld x, 200
934934 | }
935935 |
936 | routine main
936 | define main routine
937937 | outputs x, y
938938 | trashes a, z, n
939939 | {
958958 | trashes a, z, n
959959 | table[256] many
960960 |
961 | routine bar outputs x trashes a, z, n {
961 | define bar routine outputs x trashes a, z, n {
962962 | ld x, 200
963963 | }
964964 |
965 | routine main
965 | define main routine
966966 | inputs one, many
967967 | outputs one, many
968968 | trashes a, x, n, z
10031003 Adding a constant word to a word memory location.
10041004
10051005 | word score
1006 | routine main
1006 | define main routine
10071007 | inputs score
10081008 | outputs score
10091009 | trashes a, c, z, v, n
10241024
10251025 | word score
10261026 | word delta
1027 | routine main
1027 | define main routine
10281028 | inputs score, delta
10291029 | outputs score
10301030 | trashes a, c, z, v, n
10441044 Subtracting a constant word from a word memory location.
10451045
10461046 | word score
1047 | routine main
1047 | define main routine
10481048 | inputs score
10491049 | outputs score
10501050 | trashes a, c, z, v, n
10651065
10661066 | word score
10671067 | word delta
1068 | routine main
1068 | define main routine
10691069 | inputs score, delta
10701070 | outputs score
10711071 | trashes a, c, z, v, n
10891089 | buffer[2048] buf
10901090 | pointer ptr @ 254
10911091 |
1092 | routine main
1092 | define main routine
10931093 | inputs buf
10941094 | outputs buf, y
10951095 | trashes a, z, n, ptr
11091109 | buffer[2048] buf
11101110 | pointer ptr @ 254
11111111 |
1112 | routine main
1112 | define main routine
11131113 | inputs buf
11141114 | outputs buf, y
11151115 | trashes a, z, n, ptr
11331133 | pointer ptr @ 254
11341134 | byte foo
11351135 |
1136 | routine main
1136 | define main routine
11371137 | inputs foo, buf
11381138 | outputs y, buf
11391139 | trashes a, z, n, ptr
11571157 | pointer ptr @ 254
11581158 | byte foo
11591159 |
1160 | routine main
1160 | define main routine
11611161 | inputs buf
11621162 | outputs y, foo
11631163 | trashes a, z, n, ptr
11831183 | pointer ptra @ 252
11841184 | pointer ptrb @ 254
11851185 |
1186 | routine main
1186 | define main routine
11871187 | inputs buf
11881188 | outputs buf
11891189 | trashes a, y, z, n, ptra, ptrb
12121212 | pointer ptr @ 254
12131213 | byte foo
12141214 |
1215 | routine main
1215 | define main routine
12161216 | inputs buf
12171217 | outputs buf
12181218 | trashes a, y, z, n, ptr
12391239 | byte foo
12401240 | word delta
12411241 |
1242 | routine main
1242 | define main routine
12431243 | inputs buf
12441244 | outputs y, foo, delta
12451245 | trashes a, c, v, z, n, ptr
12821282
12831283 Trash does nothing except indicate that we do not care about the value anymore.
12841284
1285 | routine main
1285 | define main routine
12861286 | inputs a
12871287 | outputs x
12881288 | trashes a, z, n