diff options
Diffstat (limited to 'samples')
-rw-r--r-- | samples/Makefile.am | 16 | ||||
-rw-r--r-- | samples/echo.mixal | 10 | ||||
-rw-r--r-- | samples/hello.mixal | 11 | ||||
-rw-r--r-- | samples/m.mixal | 25 | ||||
-rw-r--r-- | samples/permutations.cardrd | 3 | ||||
-rw-r--r-- | samples/permutations.mixal | 89 | ||||
-rw-r--r-- | samples/primes.mixal | 53 | ||||
-rw-r--r-- | samples/primes.result | 51 | ||||
-rw-r--r-- | samples/tests/bt.mixal | 6 | ||||
-rw-r--r-- | samples/tests/cbp.mixal | 14 | ||||
-rw-r--r-- | samples/tests/ldan.mixal | 5 | ||||
-rw-r--r-- | samples/tests/lockonw.mixal | 3 | ||||
-rw-r--r-- | samples/tests/negwrite.mixal | 4 | ||||
-rw-r--r-- | samples/tests/stress0.mixal | 8 | ||||
-rw-r--r-- | samples/tests/stress1.mixal | 9 | ||||
-rw-r--r-- | samples/tests/stress2.mixal | 7 | ||||
-rw-r--r-- | samples/tests/stress4.mixal | 7 | ||||
-rw-r--r-- | samples/tests/stress5.mixal | 17 | ||||
-rw-r--r-- | samples/tests/stress6.mixal | 9 |
19 files changed, 347 insertions, 0 deletions
diff --git a/samples/Makefile.am b/samples/Makefile.am new file mode 100644 index 0000000..5b1ceff --- /dev/null +++ b/samples/Makefile.am @@ -0,0 +1,16 @@ +## Process this file with automake to produce Makefile.in + +# Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# $Id: Makefile.am,v 1.3 2004/06/09 13:16:42 jao Exp $ + +EXTRA_DIST = primes.result hello.mixal primes.mixal echo.mixal\ + permutations.mixal permutations.cardrd
\ No newline at end of file diff --git a/samples/echo.mixal b/samples/echo.mixal new file mode 100644 index 0000000..9b87adf --- /dev/null +++ b/samples/echo.mixal @@ -0,0 +1,10 @@ +* read from the console +TERM EQU 19 +MSG EQU 500 +PRINT EQU 20 + ORIG 1000 +START IN MSG(TERM) +* JBUS *(TERM) + OUT MSG(TERM) + HLT + END START diff --git a/samples/hello.mixal b/samples/hello.mixal new file mode 100644 index 0000000..6a4c3c1 --- /dev/null +++ b/samples/hello.mixal @@ -0,0 +1,11 @@ +* mixal hello world +* +TERM EQU 19 + ORIG 3000 +START OUT MSG(TERM) + HLT +MSG ALF "MIXAL" + ALF " HELL" + ALF "O WOR" + ALF "LD " + END START diff --git a/samples/m.mixal b/samples/m.mixal new file mode 100644 index 0000000..ae69b42 --- /dev/null +++ b/samples/m.mixal @@ -0,0 +1,25 @@ +X EQU 1000 + ORIG 3000 +MAXIMUM STJ EXIT +INIT ENT3 0,1 + JMP CHANGEM +LOOP CMPA X,3 + JGE *+3 +CHANGEM ENT2 0,3 + LDA X,3 + DEC3 1 + J3P LOOP +EXIT JMP * +START IN X+1(0) + JBUS *(0) + ENT1 100 +1H JMP MAXIMUM + LDX X,1 + STA X,1 + STX X,2 + DEC1 1 + J1P 1B + OUT X+1(1) + HLT + END START + diff --git a/samples/permutations.cardrd b/samples/permutations.cardrd new file mode 100644 index 0000000..639c1fe --- /dev/null +++ b/samples/permutations.cardrd @@ -0,0 +1,3 @@ + ( A C F G ) ( B C D ) ( A E D ) + ( F A D E ) ( B g F a E ) = + diff --git a/samples/permutations.mixal b/samples/permutations.mixal new file mode 100644 index 0000000..2c26df5 --- /dev/null +++ b/samples/permutations.mixal @@ -0,0 +1,89 @@ +* multiply permutations in cycle form (taopc p. 168) +* +MAXWDS EQU 1200 +PERM ORIG *+MAXWDS +ANS ORIG *+MAXWDS +OUTBUF ORIG *+24 +CARDS EQU 16 +PRINTER EQU 18 +BEGIN IN PERM(CARDS) + ENT2 0 + LDA EQUALS +1H JBUS *(CARDS) + CMPA PERM+15,2 + JE *+2 + IN PERM+16,2(CARDS) + ENT1 OUTBUF + JBUS *(PRINTER) + MOVE PERM,2(16) + OUT OUTBUF(PRINTER) + JE 1F + INC2 16 + CMP2 =MAXWDS-16= + JLE 1B + HLT 666 +1H INC2 15 + ST2 SIZE + ENT3 0 +2H LDAN PERM,3 + CMPA LPREN(1:5) + JNE 1F + STA PERM,3 + INC3 1 + LDXN PERM,3 + JXZ *-2 +1H CMPA RPREN(1:5) + JNE *+2 + STX PERM,3 + INC3 1 + CMP3 SIZE + JL 2B + LDA LPREN + ENT1 ANS +OPEN ENT3 0 +1H LDXN PERM,3 + JXN GO + INC3 1 + CMP3 SIZE + JL 1B +* +DONE CMP1 =ANS= + JNE *+2 + MOVE LPREN(2) + MOVE =0= + MOVE -1,1(22) + ENT3 0 + OUT ANS,3(PRINTER) + INC3 24 + LDX ANS,3 + JXNZ *-3 + HLT +* +LPREN ALF " (" +RPREN ALF ") " +EQUALS ALF " =" +* +GO MOVE LPREN + MOVE PERM,3 + STX START +SUCC STX PERM,3 + INC3 1 + LDXN PERM,3(1:5) + JXN 1F + JMP *-3 +5H STX 0,1 + INC1 1 + ENT3 0 +4H CMPX PERM,3(1:5) + JE SUCC +1H INC3 1 + CMP3 SIZE + JL 4B + CMPX START(1:5) + JNE 5B +CLOSE MOVE RPREN + CMPA -3,1 + JNE OPEN + INC1 -3 + JMP OPEN + END BEGIN diff --git a/samples/primes.mixal b/samples/primes.mixal new file mode 100644 index 0000000..365db32 --- /dev/null +++ b/samples/primes.mixal @@ -0,0 +1,53 @@ +* table of primes (taopc p. 148) +* +L EQU 500 +OUTDEV EQU 18 the printer +PRIME EQU -1 +BUF0 EQU 2000 +BUF1 EQU BUF0+25 + ORIG 3000 +START IOC 0(OUTDEV) + LD1 =1-L= + LD2 =3= +2H INC1 1 + ST2 PRIME+L,1 + J1Z 2F +4H INC2 2 + ENT3 2 +6H ENTA 0 + ENTX 0,2 + DIV PRIME,3 + JXZ 4B + CMPA PRIME,3 + INC3 1 + JG 6B + JMP 2B +2H OUT TITLE(OUTDEV) + ENT4 BUF1+10 + ENT5 -50 +2H INC5 L+1 +4H LDA PRIME,5 + CHAR + STX 0,4(1:4) + DEC4 1 + DEC5 50 + J5P 4B + OUT 0,4(OUTDEV) + LD4 24,4 + J5N 2B + HLT +* initial contents + ORIG PRIME+1 + CON 2 + ORIG BUF0-5 +TITLE ALF "FIRST" + ALF " FIVE" + ALF " HUND" + ALF "RED P" + ALF "RIMES" + ORIG BUF0+24 + CON BUF1+10 + ORIG BUF1+24 + CON BUF0+10 + END START + diff --git a/samples/primes.result b/samples/primes.result new file mode 100644 index 0000000..1431f77 --- /dev/null +++ b/samples/primes.result @@ -0,0 +1,51 @@ +FIRST FIVE HUNDRED PRIMES + 0002 0233 0547 0877 1229 1597 1993 2371 2749 3187 + 0003 0239 0557 0881 1231 1601 1997 2377 2753 3191 + 0005 0241 0563 0883 1237 1607 1999 2381 2767 3203 + 0007 0251 0569 0887 1249 1609 2003 2383 2777 3209 + 0011 0257 0571 0907 1259 1613 2011 2389 2789 3217 + 0013 0263 0577 0911 1277 1619 2017 2393 2791 3221 + 0017 0269 0587 0919 1279 1621 2027 2399 2797 3229 + 0019 0271 0593 0929 1283 1627 2029 2411 2801 3251 + 0023 0277 0599 0937 1289 1637 2039 2417 2803 3253 + 0029 0281 0601 0941 1291 1657 2053 2423 2819 3257 + 0031 0283 0607 0947 1297 1663 2063 2437 2833 3259 + 0037 0293 0613 0953 1301 1667 2069 2441 2837 3271 + 0041 0307 0617 0967 1303 1669 2081 2447 2843 3299 + 0043 0311 0619 0971 1307 1693 2083 2459 2851 3301 + 0047 0313 0631 0977 1319 1697 2087 2467 2857 3307 + 0053 0317 0641 0983 1321 1699 2089 2473 2861 3313 + 0059 0331 0643 0991 1327 1709 2099 2477 2879 3319 + 0061 0337 0647 0997 1361 1721 2111 2503 2887 3323 + 0067 0347 0653 1009 1367 1723 2113 2521 2897 3329 + 0071 0349 0659 1013 1373 1733 2129 2531 2903 3331 + 0073 0353 0661 1019 1381 1741 2131 2539 2909 3343 + 0079 0359 0673 1021 1399 1747 2137 2543 2917 3347 + 0083 0367 0677 1031 1409 1753 2141 2549 2927 3359 + 0089 0373 0683 1033 1423 1759 2143 2551 2939 3361 + 0097 0379 0691 1039 1427 1777 2153 2557 2953 3371 + 0101 0383 0701 1049 1429 1783 2161 2579 2957 3373 + 0103 0389 0709 1051 1433 1787 2179 2591 2963 3389 + 0107 0397 0719 1061 1439 1789 2203 2593 2969 3391 + 0109 0401 0727 1063 1447 1801 2207 2609 2971 3407 + 0113 0409 0733 1069 1451 1811 2213 2617 2999 3413 + 0127 0419 0739 1087 1453 1823 2221 2621 3001 3433 + 0131 0421 0743 1091 1459 1831 2237 2633 3011 3449 + 0137 0431 0751 1093 1471 1847 2239 2647 3019 3457 + 0139 0433 0757 1097 1481 1861 2243 2657 3023 3461 + 0149 0439 0761 1103 1483 1867 2251 2659 3037 3463 + 0151 0443 0769 1109 1487 1871 2267 2663 3041 3467 + 0157 0449 0773 1117 1489 1873 2269 2671 3049 3469 + 0163 0457 0787 1123 1493 1877 2273 2677 3061 3491 + 0167 0461 0797 1129 1499 1879 2281 2683 3067 3499 + 0173 0463 0809 1151 1511 1889 2287 2687 3079 3511 + 0179 0467 0811 1153 1523 1901 2293 2689 3083 3517 + 0181 0479 0821 1163 1531 1907 2297 2693 3089 3527 + 0191 0487 0823 1171 1543 1913 2309 2699 3109 3529 + 0193 0491 0827 1181 1549 1931 2311 2707 3119 3533 + 0197 0499 0829 1187 1553 1933 2333 2711 3121 3539 + 0199 0503 0839 1193 1559 1949 2339 2713 3137 3541 + 0211 0509 0853 1201 1567 1951 2341 2719 3163 3547 + 0223 0521 0857 1213 1571 1973 2347 2729 3167 3557 + 0227 0523 0859 1217 1579 1979 2351 2731 3169 3559 + 0229 0541 0863 1223 1583 1987 2357 2741 3181 3571 diff --git a/samples/tests/bt.mixal b/samples/tests/bt.mixal new file mode 100644 index 0000000..00306ae --- /dev/null +++ b/samples/tests/bt.mixal @@ -0,0 +1,6 @@ + ORIG 0 +BEG JMP *+1 + JMP *+1 +FOO JMP BAR +BAR HLT + END BEG diff --git a/samples/tests/cbp.mixal b/samples/tests/cbp.mixal new file mode 100644 index 0000000..8c7b394 --- /dev/null +++ b/samples/tests/cbp.mixal @@ -0,0 +1,14 @@ +* testing conditional breakpoints + ORIG 2000 +START ENTA 100 + STA 1000 + ENTX 200 + STX 1001 + CMPA 1001 * cmp flag changed + CMPX 1000 * cmp flag changed + DIV 1002 * over toggle + HLT + END START + + + diff --git a/samples/tests/ldan.mixal b/samples/tests/ldan.mixal new file mode 100644 index 0000000..d15c6a3 --- /dev/null +++ b/samples/tests/ldan.mixal @@ -0,0 +1,5 @@ +VAR ORIG *+1 +BEGIN LDAN VAR(1:5) + LDXN VAR(1:5) + HLT + END BEGIN diff --git a/samples/tests/lockonw.mixal b/samples/tests/lockonw.mixal new file mode 100644 index 0000000..3ddad65 --- /dev/null +++ b/samples/tests/lockonw.mixal @@ -0,0 +1,3 @@ +* test for bug #5654 +START CMPA =0=(1:4) + END START diff --git a/samples/tests/negwrite.mixal b/samples/tests/negwrite.mixal new file mode 100644 index 0000000..dfed659 --- /dev/null +++ b/samples/tests/negwrite.mixal @@ -0,0 +1,4 @@ +* test for bug #5649: invalid address in OUT +START OUT -1(18) + HLT + END START diff --git a/samples/tests/stress0.mixal b/samples/tests/stress0.mixal new file mode 100644 index 0000000..d87b743 --- /dev/null +++ b/samples/tests/stress0.mixal @@ -0,0 +1,8 @@ + ORIG 1999 +ST NOP +* SYM EQU SYM+1 +SYM2 CON SYM2+1 +SYM3 ORIG SYM3+2 +SYM4 ENTA SYM4+1 + HLT +SYM5 END SYM5+1 diff --git a/samples/tests/stress1.mixal b/samples/tests/stress1.mixal new file mode 100644 index 0000000..f9bc8c9 --- /dev/null +++ b/samples/tests/stress1.mixal @@ -0,0 +1,9 @@ + ORIG 1999 +ST NOP +3H EQU 69 +3H ENTA 3B +** According to pg 151, rA should be 69, not 2000 +** "An address of 2F or 2B never refers to its own line" + HLT + END ST + diff --git a/samples/tests/stress2.mixal b/samples/tests/stress2.mixal new file mode 100644 index 0000000..0c4d7d6 --- /dev/null +++ b/samples/tests/stress2.mixal @@ -0,0 +1,7 @@ + ORIG 1999 +ST NOP +SYM EQU SYM+1 +SYM2 CON SYM2+1 +SYM3 ORIG SYM3+2 + HLT +SYM4 END SYM4+1 diff --git a/samples/tests/stress4.mixal b/samples/tests/stress4.mixal new file mode 100644 index 0000000..7bcdd2a --- /dev/null +++ b/samples/tests/stress4.mixal @@ -0,0 +1,7 @@ + ORIG 2000 +ST NOP + ENTA FUT +** Whoa, mdk tells me FUT is never defined... +FUT EQU 69 + HLT + END ST diff --git a/samples/tests/stress5.mixal b/samples/tests/stress5.mixal new file mode 100644 index 0000000..fce18cb --- /dev/null +++ b/samples/tests/stress5.mixal @@ -0,0 +1,17 @@ +* checking output to binary device +OUTDEV EQU 1 device for output +FROM EQU 1000 +TO EQU 1099 +INITVAL EQU 1 +STEP EQU 10 + ORIG 2000 +START ENTA INITVAL + ST1 0 +LOOP STA FROM,1 + INC1 1 + INCA STEP + CMP1 =TO-FROM+1= + JNE LOOP + OUT FROM(OUTDEV) + HLT + END START diff --git a/samples/tests/stress6.mixal b/samples/tests/stress6.mixal new file mode 100644 index 0000000..a80b7c9 --- /dev/null +++ b/samples/tests/stress6.mixal @@ -0,0 +1,9 @@ +* checking input from binary device +INDEV EQU 1 device for input +OUTDEV EQU 2 device for output +MEM EQU 1000 + ORIG 2000 +START IN MEM(INDEV) + OUT MEM(OUTDEV) + HLT + END START |