From: j8takagi Date: Mon, 8 Feb 2010 19:35:47 +0000 (+0900) Subject: コマンドテスト用アセンブラファイル追加、修正 X-Git-Tag: v0.1~47^2~12 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec8eb57a5264ef792d5e37fbb4f47bf1b34e75b6;p=YACASL2.git コマンドテスト用アセンブラファイル追加、修正 --- diff --git a/as/cmd/ADDA/adda0_0.casl b/as/cmd/ADDA/adda0.casl similarity index 72% rename from as/cmd/ADDA/adda0_0.casl rename to as/cmd/ADDA/adda0.casl index ec6f2f8..7c951b1 100644 --- a/as/cmd/ADDA/adda0_0.casl +++ b/as/cmd/ADDA/adda0.casl @@ -1,5 +1,6 @@ +;;; ADDA r,adr MAIN START -BEGIN LAD GR1,A +BEGIN LD GR1,A ADDA GR1,B RET A DC 3 diff --git a/as/cmd/ADDA/adda0_ov0.casl b/as/cmd/ADDA/adda0_ov0.casl index d0f5163..ad85f71 100644 --- a/as/cmd/ADDA/adda0_ov0.casl +++ b/as/cmd/ADDA/adda0_ov0.casl @@ -1,3 +1,4 @@ +;;; ADDA r,adr 正数でオーバーフロー MAIN START LD GR1,A ADDA GR1,B diff --git a/as/cmd/ADDA/adda0_ov1.casl b/as/cmd/ADDA/adda0_ov1.casl index b3a940e..d20f312 100644 --- a/as/cmd/ADDA/adda0_ov1.casl +++ b/as/cmd/ADDA/adda0_ov1.casl @@ -1,3 +1,4 @@ +;;; ADDA r,adr 負数でオーバーフロー MAIN START LD GR1,A ADDA GR1,B diff --git a/as/cmd/ADDA/adda0_s0.casl b/as/cmd/ADDA/adda0_s0.casl index 3770d34..b4d33f9 100644 --- a/as/cmd/ADDA/adda0_s0.casl +++ b/as/cmd/ADDA/adda0_s0.casl @@ -1,3 +1,4 @@ +;;; ADDA r,adr 演算結果が負数(r > adr) MAIN START LD GR1,A ADDA GR1,B diff --git a/as/cmd/ADDA/adda0_s1.casl b/as/cmd/ADDA/adda0_s1.casl index 3b8fd4d..bef7e13 100644 --- a/as/cmd/ADDA/adda0_s1.casl +++ b/as/cmd/ADDA/adda0_s1.casl @@ -1,3 +1,4 @@ +;;; ADDA r,adr 演算結果が負数(r < adr) MAIN START LD GR1,A ADDA GR1,B diff --git a/as/cmd/ADDA/adda0_z.casl b/as/cmd/ADDA/adda0_z.casl new file mode 100644 index 0000000..cee1302 --- /dev/null +++ b/as/cmd/ADDA/adda0_z.casl @@ -0,0 +1,8 @@ +;;; ADDA r,adr 演算結果が零 +MAIN START + LD GR1,A + ADDA GR1,B + RET +A DC -10 + DC 10 + END diff --git a/as/cmd/ADDA/adda1.casl b/as/cmd/ADDA/adda1.casl new file mode 100644 index 0000000..023afe6 --- /dev/null +++ b/as/cmd/ADDA/adda1.casl @@ -0,0 +1,9 @@ +;;; ADDA r,adr,x +MAIN START +BEGIN LD GR1,A + LAD GR2,1 + ADDA GR1,A,GR2 + RET +A DC 3 + DC 1 + END diff --git a/as/cmd/ADDA/adda1_ov0.casl b/as/cmd/ADDA/adda1_ov0.casl index 1a38af5..9c40503 100644 --- a/as/cmd/ADDA/adda1_ov0.casl +++ b/as/cmd/ADDA/adda1_ov0.casl @@ -1,8 +1,9 @@ +;;; ADDA r,adr,x 負数でオーバーフロー MAIN START LD GR1,A - LD GR2,B - ADDA GR1,GR2 + LAD GR2,1 + ADDA GR1,A,GR2 RET -A DC 32767 -B DC 10 +A DC #8001 ; -32767 + DC #FFF6 ; -10 END diff --git a/as/cmd/ADDA/adda1_ov1.casl b/as/cmd/ADDA/adda1_ov1.casl index 326a3d1..9c40503 100644 --- a/as/cmd/ADDA/adda1_ov1.casl +++ b/as/cmd/ADDA/adda1_ov1.casl @@ -1,8 +1,9 @@ +;;; ADDA r,adr,x 負数でオーバーフロー MAIN START LD GR1,A - LD GR2,B - ADDA GR1,GR2 + LAD GR2,1 + ADDA GR1,A,GR2 RET -A DC -32767 -B DC -10 +A DC #8001 ; -32767 + DC #FFF6 ; -10 END diff --git a/as/cmd/ADDA/adda1_s0.casl b/as/cmd/ADDA/adda1_s0.casl index 054f189..0c482b5 100644 --- a/as/cmd/ADDA/adda1_s0.casl +++ b/as/cmd/ADDA/adda1_s0.casl @@ -1,8 +1,9 @@ +;;; ADDA r,adr,x 演算結果が負数(r > adr) MAIN START LD GR1,A - LD GR2,B - ADDA GR1,GR2 + LAD GR2,1 + ADDA GR1,A,GR2 RET A DC 10 -B DC #FFEC ; -20 + DC #FFEC ; -20 END diff --git a/as/cmd/ADDA/adda1_s1.casl b/as/cmd/ADDA/adda1_s1.casl index 9f28bc1..4fe0c37 100644 --- a/as/cmd/ADDA/adda1_s1.casl +++ b/as/cmd/ADDA/adda1_s1.casl @@ -1,8 +1,9 @@ +;;; ADDA r,adr,x 演算結果が負数(r < adr) MAIN START LD GR1,A - LD GR2,B - ADDA GR1,GR2 + LAD GR2,1 + ADDA GR1,A,GR2 RET A DC -10 -B DC 20 + DC 20 END diff --git a/as/cmd/ADDA/adda1_z.casl b/as/cmd/ADDA/adda1_z.casl new file mode 100644 index 0000000..1003ab5 --- /dev/null +++ b/as/cmd/ADDA/adda1_z.casl @@ -0,0 +1,9 @@ +;;; ADDA r1,adr,x 演算結果が零 +MAIN START + LD GR1,A + LAD GR2,1 + ADDA GR1,A,GR2 + RET +A DC -10 + DC 10 + END diff --git a/as/cmd/ADDA/adda1_0.casl b/as/cmd/ADDA/adda2.casl similarity index 90% rename from as/cmd/ADDA/adda1_0.casl rename to as/cmd/ADDA/adda2.casl index 6c69581..eee6ad5 100644 --- a/as/cmd/ADDA/adda1_0.casl +++ b/as/cmd/ADDA/adda2.casl @@ -1,3 +1,4 @@ +;;; ADDA r1,r2 MAIN START BEGIN LD GR1,A LD GR2,B diff --git a/as/cmd/ADDA/adda2_ov0.casl b/as/cmd/ADDA/adda2_ov0.casl new file mode 100644 index 0000000..afbd655 --- /dev/null +++ b/as/cmd/ADDA/adda2_ov0.casl @@ -0,0 +1,9 @@ +;;; ADDA r1,r2 正数でオーバーフロー +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC 32767 +B DC 10 + END diff --git a/as/cmd/ADDA/adda2_ov1.casl b/as/cmd/ADDA/adda2_ov1.casl new file mode 100644 index 0000000..c26cf69 --- /dev/null +++ b/as/cmd/ADDA/adda2_ov1.casl @@ -0,0 +1,9 @@ +;;; ADDA r1,r2 負数でオーバーフロー +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC -32767 +B DC -10 + END diff --git a/as/cmd/ADDA/adda2_s0.casl b/as/cmd/ADDA/adda2_s0.casl new file mode 100644 index 0000000..57b8579 --- /dev/null +++ b/as/cmd/ADDA/adda2_s0.casl @@ -0,0 +1,9 @@ +;;; ADDA r1,r2 演算結果が負数(r1 > r2) +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC 10 +B DC #FFEC ; -20 + END diff --git a/as/cmd/ADDA/adda2_s1.casl b/as/cmd/ADDA/adda2_s1.casl new file mode 100644 index 0000000..4a86734 --- /dev/null +++ b/as/cmd/ADDA/adda2_s1.casl @@ -0,0 +1,9 @@ +;;; ADDA r1,r2 演算結果が負数(r1 < r2) +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC -10 +B DC 20 + END diff --git a/as/cmd/ADDA/adda2_z.casl b/as/cmd/ADDA/adda2_z.casl new file mode 100644 index 0000000..2e879b8 --- /dev/null +++ b/as/cmd/ADDA/adda2_z.casl @@ -0,0 +1,9 @@ +;;; ADDA r1,r2 演算結果が零 +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC -10 +B DC 10 + END diff --git a/as/cmd/ADDL/addl0.casl b/as/cmd/ADDL/addl0.casl index 5e2924c..2128758 100644 --- a/as/cmd/ADDL/addl0.casl +++ b/as/cmd/ADDL/addl0.casl @@ -1,3 +1,4 @@ +;;; ADDL r,addr[,x] MAIN START BEGIN LAD GR1,A ADDL GR1,B diff --git a/as/cmd/ADDL/addl0_ov0.casl b/as/cmd/ADDL/addl0_ov0.casl index 2c48a47..e8d10a0 100644 --- a/as/cmd/ADDL/addl0_ov0.casl +++ b/as/cmd/ADDL/addl0_ov0.casl @@ -1,3 +1,4 @@ +;;; ADDL r,addr[,x] 正数でオーバーフロー発生 MAIN START LD GR1,A ADDL GR1,B diff --git a/as/cmd/ADDL/addl0_ov1.casl b/as/cmd/ADDL/addl0_ov1.casl index 4ef996f..c99962c 100644 --- a/as/cmd/ADDL/addl0_ov1.casl +++ b/as/cmd/ADDL/addl0_ov1.casl @@ -1,3 +1,4 @@ +;;; ADDL r,addr[,x] 負数でオーバーフロー発生 MAIN START LD GR1,A ADDL GR1,B diff --git a/as/cmd/ADDL/addl0_s0.casl b/as/cmd/ADDL/addl0_s0.casl index 215236d..85b25ce 100644 --- a/as/cmd/ADDL/addl0_s0.casl +++ b/as/cmd/ADDL/addl0_s0.casl @@ -1,7 +1,8 @@ +;;; ADDL r,addr[,x] 演算結果の符号が負(r > adr) MAIN START LD GR1,A ADDL GR1,B RET A DC 10 -B DC #FFEC ; 65516 +B DC #FFEC ; -20 END diff --git a/as/cmd/ADDL/addl0_s1.casl b/as/cmd/ADDL/addl0_s1.casl new file mode 100644 index 0000000..59c29f5 --- /dev/null +++ b/as/cmd/ADDL/addl0_s1.casl @@ -0,0 +1,8 @@ +;;; ADDL r,addr[,x] 演算結果の符号が負(r < adr) +MAIN START + LD GR1,A + ADDL GR1,B + RET +A DC #FFEC ; -20 +B DC 10 + END diff --git a/as/cmd/ADDL/addl0_z.casl b/as/cmd/ADDL/addl0_z.casl new file mode 100644 index 0000000..d082259 --- /dev/null +++ b/as/cmd/ADDL/addl0_z.casl @@ -0,0 +1,8 @@ +;;; ADDL r,addr[,x] 演算結果が零 +MAIN START + LD GR1,A + ADDL GR1,B + RET +A DC 10 +B DC #FFF6 ; -10 + END diff --git a/as/cmd/ADDL/addl1.casl b/as/cmd/ADDL/addl1.casl index 6c69581..aff696b 100644 --- a/as/cmd/ADDL/addl1.casl +++ b/as/cmd/ADDL/addl1.casl @@ -1,3 +1,4 @@ +;;; ADDL r1,r2 MAIN START BEGIN LD GR1,A LD GR2,B diff --git a/as/cmd/ADDL/addl1_ov0.casl b/as/cmd/ADDL/addl1_ov0.casl index 1a38af5..ca3fc2e 100644 --- a/as/cmd/ADDL/addl1_ov0.casl +++ b/as/cmd/ADDL/addl1_ov0.casl @@ -1,3 +1,4 @@ +;;; ADDL r1,r2 正数でオーバーフロー発生 MAIN START LD GR1,A LD GR2,B diff --git a/as/cmd/ADDL/addl1_ov1.casl b/as/cmd/ADDL/addl1_ov1.casl index 326a3d1..104b431 100644 --- a/as/cmd/ADDL/addl1_ov1.casl +++ b/as/cmd/ADDL/addl1_ov1.casl @@ -1,3 +1,4 @@ +;;; ADDL r1,r2 負数でオーバーフロー発生 MAIN START LD GR1,A LD GR2,B diff --git a/as/cmd/ADDL/addl1_s0.casl b/as/cmd/ADDL/addl1_s0.casl index 34da997..1db3977 100644 --- a/as/cmd/ADDL/addl1_s0.casl +++ b/as/cmd/ADDL/addl1_s0.casl @@ -1,8 +1,9 @@ +;;; ADDL r1,r2 演算結果の符号が負(r1 > r2) MAIN START LD GR1,A LD GR2,B ADDL GR1,GR2 RET A DC 10 -B DC #FFEC ; 65516 +B DC #FFEC ; -20 END diff --git a/as/cmd/ADDL/addl1_s1.casl b/as/cmd/ADDL/addl1_s1.casl new file mode 100644 index 0000000..2fde062 --- /dev/null +++ b/as/cmd/ADDL/addl1_s1.casl @@ -0,0 +1,9 @@ +;;; ADDL r1,r2 演算結果の符号が負(r1 < r2) +MAIN START + LD GR1,A + LD GR2,B + ADDL GR1,GR2 + RET +A DC #FFEC ; -20 +B DC 10 + END diff --git a/as/cmd/ADDL/addl1_z.casl b/as/cmd/ADDL/addl1_z.casl new file mode 100644 index 0000000..52b9e2d --- /dev/null +++ b/as/cmd/ADDL/addl1_z.casl @@ -0,0 +1,9 @@ +;;; ADDL r1,r2 演算結果が零 +MAIN START + LD GR1,A + LD GR2,B + ADDL GR1,GR2 + RET +A DC 10 +B DC #FFF6 ; -10 + END diff --git a/as/cmd/AND/and0.casl b/as/cmd/AND/and0.casl index c6169ec..1fe63d1 100644 --- a/as/cmd/AND/and0.casl +++ b/as/cmd/AND/and0.casl @@ -1,3 +1,4 @@ +;;; AND r,adr[,x] MAIN START LD GR1,A AND GR1,B diff --git a/as/cmd/AND/and0_s.casl b/as/cmd/AND/and0_s.casl index bfbd457..448c768 100644 --- a/as/cmd/AND/and0_s.casl +++ b/as/cmd/AND/and0_s.casl @@ -1,3 +1,4 @@ +;;; AND r,adr[,x] 演算結果の符号が負 MAIN START LD GR1,A AND GR1,B diff --git a/as/cmd/AND/and0_z.casl b/as/cmd/AND/and0_z.casl index 64270ec..0ac684e 100644 --- a/as/cmd/AND/and0_z.casl +++ b/as/cmd/AND/and0_z.casl @@ -1,3 +1,4 @@ +;;; AND r,adr[,x] 演算結果が零 MAIN START LD GR1,A AND GR1,B diff --git a/as/cmd/AND/and1.casl b/as/cmd/AND/and1.casl index d41a1d8..91ea8cf 100644 --- a/as/cmd/AND/and1.casl +++ b/as/cmd/AND/and1.casl @@ -1,3 +1,4 @@ +;;; AND r1,r2 MAIN START LD GR1,A LD GR2,B diff --git a/as/cmd/AND/and1_s.casl b/as/cmd/AND/and1_s.casl index ad41d24..c7f520c 100644 --- a/as/cmd/AND/and1_s.casl +++ b/as/cmd/AND/and1_s.casl @@ -1,3 +1,4 @@ +;;; AND r1,r2 演算結果の符号が負 MAIN START LD GR1,A LD GR2,B diff --git a/as/cmd/AND/and1_z.casl b/as/cmd/AND/and1_z.casl index 1135b54..a91dbdf 100644 --- a/as/cmd/AND/and1_z.casl +++ b/as/cmd/AND/and1_z.casl @@ -1,3 +1,4 @@ +;;; AND r1,r2 演算結果が零 MAIN START LD GR1,A LD GR2,B diff --git a/as/cmd/CALL/call0.casl b/as/cmd/CALL/call0.casl index d6a6a40..ec37f34 100644 --- a/as/cmd/CALL/call0.casl +++ b/as/cmd/CALL/call0.casl @@ -1,4 +1,5 @@ -MAIN START +;;; CALL ほかのプログラムの入口名を指定 + MAIN START LAD GR1,29 CALL COPY RET diff --git a/as/cmd/CALL/call1.casl b/as/cmd/CALL/call1.casl index bc420fb..70f8ae0 100644 --- a/as/cmd/CALL/call1.casl +++ b/as/cmd/CALL/call1.casl @@ -1,3 +1,4 @@ +;;; CALL 同じプログラムの中にあるラベルを指定 MAIN START BEGIN BEGIN LAD GR1,29 CALL COPY diff --git a/as/cmd/CALL/call2.casl b/as/cmd/CALL/call2.casl deleted file mode 100644 index afa5fdd..0000000 --- a/as/cmd/CALL/call2.casl +++ /dev/null @@ -1,11 +0,0 @@ -MAIN START BEGIN -BEGIN LD GR1,=29 - CALL INCR - ST GR1,A - RET -A DS 1 - END -INCR START - ADDA GR1,=1 - RET -FIN END diff --git a/as/cmd/CPA/cpa0_0.casl b/as/cmd/CPA/cpa0_0.casl new file mode 100644 index 0000000..9ce1eb9 --- /dev/null +++ b/as/cmd/CPA/cpa0_0.casl @@ -0,0 +1,7 @@ +MAIN START BEGIN +BEGIN LD GR1,A + CPA GR1,B + RET +A DC #5000 +B DC #7000 + END diff --git a/as/cmd/CPA/cpa0_1.casl b/as/cmd/CPA/cpa0_1.casl new file mode 100644 index 0000000..ef5ec06 --- /dev/null +++ b/as/cmd/CPA/cpa0_1.casl @@ -0,0 +1,7 @@ +MAIN START BEGIN +BEGIN LD GR1,A + CPA GR1,B + RET +A DC #5000 +B DC #3000 + END diff --git a/as/cmd/CPA/cpa0_2.casl b/as/cmd/CPA/cpa0_2.casl new file mode 100644 index 0000000..adca4a5 --- /dev/null +++ b/as/cmd/CPA/cpa0_2.casl @@ -0,0 +1,7 @@ +MAIN START BEGIN +BEGIN LD GR1,A + CPA GR1,B + RET +A DC #5000 +B DC #5000 + END diff --git a/as/cmd/CPA/cpa0_3.casl b/as/cmd/CPA/cpa0_3.casl new file mode 100644 index 0000000..1c24511 --- /dev/null +++ b/as/cmd/CPA/cpa0_3.casl @@ -0,0 +1,7 @@ +MAIN START BEGIN +BEGIN LD GR1,A + CPA GR1,B + RET +A DC #5000 +B DC #8000 + END diff --git a/as/cmd/CPA/cpa1.casl b/as/cmd/CPA/cpa1_0.casl similarity index 78% rename from as/cmd/CPA/cpa1.casl rename to as/cmd/CPA/cpa1_0.casl index a5ca590..551c76a 100644 --- a/as/cmd/CPA/cpa1.casl +++ b/as/cmd/CPA/cpa1_0.casl @@ -1,6 +1,6 @@ MAIN START BEGIN BEGIN LAD GR1,#5000 - LAD GR2,#F000 + LAD GR2,#7000 CPA GR2,GR1 RET END diff --git a/as/cmd/CPA/cpa1_1.casl b/as/cmd/CPA/cpa1_1.casl new file mode 100644 index 0000000..45c7ae9 --- /dev/null +++ b/as/cmd/CPA/cpa1_1.casl @@ -0,0 +1,6 @@ +MAIN START BEGIN +BEGIN LAD GR1,#5000 + LAD GR2,#3000 + CPA GR2,GR1 + RET + END diff --git a/as/cmd/CPA/cpa1_2.casl b/as/cmd/CPA/cpa1_2.casl new file mode 100644 index 0000000..2eb7c86 --- /dev/null +++ b/as/cmd/CPA/cpa1_2.casl @@ -0,0 +1,6 @@ +MAIN START BEGIN +BEGIN LAD GR1,#5000 + LAD GR2,#5000 + CPA GR1,GR2 + RET + END diff --git a/as/cmd/CPA/cpa1_3.casl b/as/cmd/CPA/cpa1_3.casl new file mode 100644 index 0000000..99af974 --- /dev/null +++ b/as/cmd/CPA/cpa1_3.casl @@ -0,0 +1,8 @@ +MAIN START BEGIN +BEGIN LD GR1,A + LD GR2,B + CPA GR1,GR2 + RET +A DC #5000 +B DC #8000 + END diff --git a/as/cmd/literal_semi.casl b/as/cmd/literal_semi.casl new file mode 100644 index 0000000..a3cc7ea --- /dev/null +++ b/as/cmd/literal_semi.casl @@ -0,0 +1,4 @@ +MAIN START + LAD GR1,=';' ; 「;」の処理が正常にできるか +FIN RET + END diff --git a/as/err/opd_x_err.casl b/as/err/opd_x_err.casl new file mode 100644 index 0000000..ee98241 --- /dev/null +++ b/as/err/opd_x_err.casl @@ -0,0 +1,9 @@ +;;; ADDA r,adr,x 演算結果が負数(r < adr) +MAIN START + LD GR1,A + LAD GR2,1 + ADDA GR1,A,1 + RET +A DC -10 + DC 20 + END