From: j8takagi Date: Thu, 11 Feb 2010 13:18:15 +0000 (+0900) Subject: コマンドテストCASLファイルの追加、整理 X-Git-Tag: v0.1~47^2~6 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79c9b16dc33c688a93d47bd52e558e54fb875331;p=YACASL2.git コマンドテストCASLファイルの追加、整理 --- diff --git a/as/cmd/AND/and0.casl b/as/cmd/AND/and0.casl index 1fe63d1..b389e00 100644 --- a/as/cmd/AND/and0.casl +++ b/as/cmd/AND/and0.casl @@ -1,4 +1,4 @@ -;;; AND r,adr[,x] +;;; AND r,adr 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 448c768..b8aee82 100644 --- a/as/cmd/AND/and0_s.casl +++ b/as/cmd/AND/and0_s.casl @@ -1,4 +1,4 @@ -;;; AND r,adr[,x] 演算結果の符号が負 +;;; AND r,adr 演算結果の符号が負 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 0ac684e..a33e69b 100644 --- a/as/cmd/AND/and0_z.casl +++ b/as/cmd/AND/and0_z.casl @@ -1,4 +1,4 @@ -;;; AND r,adr[,x] 演算結果が零 +;;; AND r,adr 演算結果が零 MAIN START LD GR1,A AND GR1,B diff --git a/as/cmd/AND/and1.casl b/as/cmd/AND/and1.casl index 91ea8cf..abec8ed 100644 --- a/as/cmd/AND/and1.casl +++ b/as/cmd/AND/and1.casl @@ -1,9 +1,8 @@ -;;; AND r1,r2 +;;; AND r,adr MAIN START LD GR1,A - LD GR2,B - AND GR1,GR2 + AND GR1,1,A RET A DC #3000 -B DC #4FFF + DC #4FFF END diff --git a/as/cmd/AND/and2.casl b/as/cmd/AND/and2.casl new file mode 100644 index 0000000..91ea8cf --- /dev/null +++ b/as/cmd/AND/and2.casl @@ -0,0 +1,9 @@ +;;; AND r1,r2 +MAIN START + LD GR1,A + LD GR2,B + AND GR1,GR2 + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/cmd/IN/in.casl b/as/cmd/IN/in.casl new file mode 100644 index 0000000..248762f --- /dev/null +++ b/as/cmd/IN/in.casl @@ -0,0 +1,7 @@ +;;; IN IBUF,ILEN +MAIN START +LOOP IN IBUF,ILEN +FIN RET +IBUF DS 20 +ILEN DS 1 + END diff --git a/as/cmd/LAD/lad0_l.casl b/as/cmd/LAD/lad0_l.casl deleted file mode 100644 index 0a9c296..0000000 --- a/as/cmd/LAD/lad0_l.casl +++ /dev/null @@ -1,5 +0,0 @@ -;;; LAD r,adr -MAIN START - LAD GR1,='A' - RET - END diff --git a/as/cmd/LAD/lad2.casl b/as/cmd/LAD/lad2.casl deleted file mode 100644 index 5d75b42..0000000 --- a/as/cmd/LAD/lad2.casl +++ /dev/null @@ -1,5 +0,0 @@ -LAD1 START - LAD GR1,10 - LAD GR1,65534,GR1 - RET - END diff --git a/as/cmd/LAD/lad3.casl b/as/cmd/LAD/lad3.casl deleted file mode 100644 index bd8d349..0000000 --- a/as/cmd/LAD/lad3.casl +++ /dev/null @@ -1,5 +0,0 @@ -LAD1 START - LAD GR1,-1 - LAD GR1,65535,GR1 - RET - END diff --git a/as/cmd/LAD/lad4.casl b/as/cmd/LAD/lad4.casl deleted file mode 100644 index 1711f01..0000000 --- a/as/cmd/LAD/lad4.casl +++ /dev/null @@ -1,6 +0,0 @@ -MAIN START BEGIN -BEGIN LD GR7,A - LAD GR7,1,GR7 - RET -A DC 3 - END diff --git a/as/cmd/LD/ld0_l.casl b/as/cmd/LD/ld0_l.casl new file mode 100644 index 0000000..b23b09e --- /dev/null +++ b/as/cmd/LD/ld0_l.casl @@ -0,0 +1,97 @@ +;;; LD r,adr +MAIN START + LD GR1,='"' + LD GR1,='#' + LD GR1,='$' + LD GR1,='%' + LD GR1,='&' + LD GR1,='''' + LD GR1,='(' + LD GR1,=')' + LD GR1,='*' + LD GR1,='+' + LD GR1,=',' + LD GR1,='-' + LD GR1,='.' + LD GR1,='/' + LD GR1,='0' + LD GR1,='1' + LD GR1,='2' + LD GR1,='3' + LD GR1,='4' + LD GR1,='5' + LD GR1,='6' + LD GR1,='7' + LD GR1,='8' + LD GR1,='9' + LD GR1,=':' + LD GR1,=';' + LD GR1,='<' + LD GR1,='=' + LD GR1,='>' + LD GR1,='?' + LD GR1,='@' + LD GR1,='A' + LD GR1,='B' + LD GR1,='C' + LD GR1,='D' + LD GR1,='E' + LD GR1,='F' + LD GR1,='G' + LD GR1,='H' + LD GR1,='I' + LD GR1,='J' + LD GR1,='K' + LD GR1,='L' + LD GR1,='M' + LD GR1,='N' + LD GR1,='O' + LD GR1,='P' + LD GR1,='Q' + LD GR1,='R' + LD GR1,='S' + LD GR1,='T' + LD GR1,='U' + LD GR1,='V' + LD GR1,='W' + LD GR1,='X' + LD GR1,='Y' + LD GR1,='Z' + LD GR1,='[' + LD GR1,='\' + LD GR1,=']' + LD GR1,='^' + LD GR1,='_' + LD GR1,='`' + LD GR1,='a' + LD GR1,='b' + LD GR1,='c' + LD GR1,='d' + LD GR1,='e' + LD GR1,='f' + LD GR1,='g' + LD GR1,='h' + LD GR1,='i' + LD GR1,='j' + LD GR1,='k' + LD GR1,='l' + LD GR1,='m' + LD GR1,='n' + LD GR1,='o' + LD GR1,='p' + LD GR1,='q' + LD GR1,='r' + LD GR1,='s' + LD GR1,='t' + LD GR1,='u' + LD GR1,='v' + LD GR1,='w' + LD GR1,='x' + LD GR1,='y' + LD GR1,='z' + LD GR1,='{' + LD GR1,='|' + LD GR1,='}' + LD GR1,='~' + RET + END diff --git a/as/cmd/LD/ld3.casl b/as/cmd/LD/ld3.casl deleted file mode 100644 index 733c109..0000000 --- a/as/cmd/LD/ld3.casl +++ /dev/null @@ -1,5 +0,0 @@ -MAIN START -BEGIN LD GR1,I - RET -I DC 17 - END diff --git a/as/cmd/LD/ld4.casl b/as/cmd/LD/ld4.casl deleted file mode 100644 index d6723d6..0000000 --- a/as/cmd/LD/ld4.casl +++ /dev/null @@ -1,9 +0,0 @@ -; LDコマンド -MAIN START BEGIN -BEGIN LD GR1,A - LD GR2,B - ADDL GR1,GR2 - RET -A DC 32767 -B DC 32675 - END diff --git a/as/cmd/LD/ld5.casl b/as/cmd/LD/ld5.casl deleted file mode 100644 index 2b40d74..0000000 --- a/as/cmd/LD/ld5.casl +++ /dev/null @@ -1,8 +0,0 @@ -; LDコマンド -MAIN START BEGIN -BEGIN LAD GR2,1 - LD GR1,A,GR2 - RET -A DC 1 -B DC 2 - END diff --git a/as/cmd/LD/ld_loop.casl b/as/cmd/LD/ld_loop.casl deleted file mode 100644 index 5e21750..0000000 --- a/as/cmd/LD/ld_loop.casl +++ /dev/null @@ -1,12 +0,0 @@ -;;; ループを使い、連続でGR1にデータを転送する -MAIN START - LAD GR2,0 -MLOOP CPA GR2,LEN - JZE MEND - LD GR1,DATA,GR2 - LAD GR2,1,GR2 - JUMP MLOOP -MEND RET -DATA DC #9600,#F000,#A400 -LEN DC 3 - END diff --git a/as/cmd/NOP/nop.casl b/as/cmd/NOP/nop.casl index 362bc6c..6facee4 100644 --- a/as/cmd/NOP/nop.casl +++ b/as/cmd/NOP/nop.casl @@ -1,3 +1,4 @@ +;;; NOP MAIN START NOP NOP @@ -10,4 +11,3 @@ MAIN START NOP RET END - \ No newline at end of file diff --git a/as/cmd/OR/or0.casl b/as/cmd/OR/or0.casl new file mode 100644 index 0000000..d23f8c2 --- /dev/null +++ b/as/cmd/OR/or0.casl @@ -0,0 +1,8 @@ +;;; OR r,adr +MAIN START + LD GR1,A + OR GR1,B + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/cmd/OR/or0_s.casl b/as/cmd/OR/or0_s.casl new file mode 100644 index 0000000..7c29667 --- /dev/null +++ b/as/cmd/OR/or0_s.casl @@ -0,0 +1,8 @@ +;;; OR r,adr 演算結果の符号が負 +MAIN START + LD GR1,A + OR GR1,B + RET +A DC #8000 +B DC #FFFF + END diff --git a/as/cmd/OR/or0_z.casl b/as/cmd/OR/or0_z.casl new file mode 100644 index 0000000..d4843e8 --- /dev/null +++ b/as/cmd/OR/or0_z.casl @@ -0,0 +1,8 @@ +;;; OR r,adr 演算結果が零 +MAIN START + LD GR1,A + OR GR1,B + RET +A DC #0001 +B DC #FFFE + END diff --git a/as/cmd/OR/or1.casl b/as/cmd/OR/or1.casl new file mode 100644 index 0000000..1067c46 --- /dev/null +++ b/as/cmd/OR/or1.casl @@ -0,0 +1,8 @@ +;;; OR r,adr +MAIN START + LD GR1,A + OR GR1,1,A + RET +A DC #3000 + DC #4FFF + END diff --git a/as/cmd/OR/or2.casl b/as/cmd/OR/or2.casl new file mode 100644 index 0000000..63be2ca --- /dev/null +++ b/as/cmd/OR/or2.casl @@ -0,0 +1,9 @@ +;;; OR r1,r2 +MAIN START + LD GR1,A + LD GR2,B + OR GR1,GR2 + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/cmd/OUT/out1.casl b/as/cmd/OUT/out.casl similarity index 92% rename from as/cmd/OUT/out1.casl rename to as/cmd/OUT/out.casl index 851ef6c..2a491fe 100644 --- a/as/cmd/OUT/out1.casl +++ b/as/cmd/OUT/out.casl @@ -1,5 +1,5 @@ -;;; OUTの使用例 -OTEST START +;;; OUT buf.len +MAIN START OUT BUF1,L1 OUT BUF2,L2 OUT BUF3,L3 diff --git a/as/cmd/OUT/out0.casl b/as/cmd/OUT/out0.casl deleted file mode 100644 index 4f046e3..0000000 --- a/as/cmd/OUT/out0.casl +++ /dev/null @@ -1,6 +0,0 @@ -MAIN START - OUT BUF,LEN - RET -BUF DC '0' -LEN DC 1 - END diff --git a/as/cmd/POP/push_pop_0.casl b/as/cmd/POP/push_pop_0.casl new file mode 100644 index 0000000..cdf1a64 --- /dev/null +++ b/as/cmd/POP/push_pop_0.casl @@ -0,0 +1,27 @@ +;;; PUSH / POP 値の復元 +MAIN START + LD GR1,A + LD GR1,0,GR7 + LD GR2,1,GR7 + LD GR3,2,GR7 + LD GR4,3,GR7 + LD GR5,4,GR7 + LD GR6,5,GR7 + LD GR7,6,GR7 + PUSH 0,GR1 + PUSH 0,GR2 + PUSH 0,GR3 + PUSH 0,GR4 + PUSH 0,GR5 + PUSH 0,GR6 + PUSH 0,GR7 + POP GR7 + POP GR6 + POP GR5 + POP GR4 + POP GR3 + POP GR2 + POP GR1 + RET +A DC 1,2,3,4,5,6,7 + END diff --git a/as/cmd/POP/push_pop_1.casl b/as/cmd/POP/push_pop_1.casl new file mode 100644 index 0000000..08f4c43 --- /dev/null +++ b/as/cmd/POP/push_pop_1.casl @@ -0,0 +1,27 @@ +;;; PUSH / POP 値の交換 +MAIN START + LD GR1,A + LD GR1,0,GR7 + LD GR2,1,GR7 + LD GR3,2,GR7 + LD GR4,3,GR7 + LD GR5,4,GR7 + LD GR6,5,GR7 + LD GR7,6,GR7 + PUSH 0,GR1 + PUSH 0,GR2 + PUSH 0,GR3 + PUSH 0,GR4 + PUSH 0,GR5 + PUSH 0,GR6 + PUSH 0,GR7 + POP GR1 + POP GR2 + POP GR3 + POP GR4 + POP GR5 + POP GR6 + POP GR7 + RET +A DC 1,2,3,4,5,6,7 + END diff --git a/as/cmd/PUSH/README b/as/cmd/PUSH/README new file mode 100644 index 0000000..f6733a3 --- /dev/null +++ b/as/cmd/PUSH/README @@ -0,0 +1 @@ +see POP diff --git a/as/cmd/PUSH/pushpop.casl b/as/cmd/PUSH/pushpop.casl deleted file mode 100644 index f8c8d33..0000000 --- a/as/cmd/PUSH/pushpop.casl +++ /dev/null @@ -1,11 +0,0 @@ -PUSHPOP START - LAD GR1,1 - LAD GR2,2 - PUSH 0,GR1 - PUSH 0,GR2 - LAD GR1,0 - LAD GR2,0 - POP GR2 - POP GR1 - RET - END diff --git a/as/cmd/RET/README b/as/cmd/RET/README new file mode 100644 index 0000000..aa33c9c --- /dev/null +++ b/as/cmd/RET/README @@ -0,0 +1 @@ +see CALL diff --git a/as/cmd/RPOP/rpop.casl b/as/cmd/RPOP/rpop.casl new file mode 100644 index 0000000..c6c31bd --- /dev/null +++ b/as/cmd/RPOP/rpop.casl @@ -0,0 +1,21 @@ +;;; RPOP 値の復元 +MAIN START + LD GR1,A + LD GR1,0,GR7 + LD GR2,1,GR7 + LD GR3,2,GR7 + LD GR4,3,GR7 + LD GR5,4,GR7 + LD GR6,5,GR7 + LD GR7,6,GR7 + PUSH 0,GR1 + PUSH 0,GR2 + PUSH 0,GR3 + PUSH 0,GR4 + PUSH 0,GR5 + PUSH 0,GR6 + PUSH 0,GR7 + RPOP + RET +A DC 1,2,3,4,5,6,7 + END diff --git a/as/cmd/RPUSH/rpush.casl b/as/cmd/RPUSH/rpush.casl new file mode 100644 index 0000000..3a86ea2 --- /dev/null +++ b/as/cmd/RPUSH/rpush.casl @@ -0,0 +1,21 @@ +;;; PUSH / POP 値の復元 +MAIN START + LD GR1,A + LD GR1,0,GR7 + LD GR2,1,GR7 + LD GR3,2,GR7 + LD GR4,3,GR7 + LD GR5,4,GR7 + LD GR6,5,GR7 + LD GR7,6,GR7 + RPUSH + POP GR7 + POP GR6 + POP GR5 + POP GR4 + POP GR3 + POP GR2 + POP GR1 + RET +A DC 1,2,3,4,5,6,7 + END diff --git a/as/cmd/SLA/sla_1.casl b/as/cmd/SLA/sla_1.casl new file mode 100644 index 0000000..51bc045 --- /dev/null +++ b/as/cmd/SLA/sla_1.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,3 + SLA GR1,2 + RET + END diff --git a/as/cmd/SLA/sla_2.casl b/as/cmd/SLA/sla_2.casl new file mode 100644 index 0000000..1a5e0c3 --- /dev/null +++ b/as/cmd/SLA/sla_2.casl @@ -0,0 +1,5 @@ +SLA2 START BEGIN +BEGIN LAD GR1,#FFFD + SLA GR1,2 + RET + END diff --git a/as/cmd/SLA/sla_m.casl b/as/cmd/SLA/sla_m.casl new file mode 100644 index 0000000..1a5e0c3 --- /dev/null +++ b/as/cmd/SLA/sla_m.casl @@ -0,0 +1,5 @@ +SLA2 START BEGIN +BEGIN LAD GR1,#FFFD + SLA GR1,2 + RET + END diff --git a/as/cmd/SLA/sla_o.casl b/as/cmd/SLA/sla_o.casl new file mode 100644 index 0000000..ab7aac9 --- /dev/null +++ b/as/cmd/SLA/sla_o.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,#4000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SLA/sla_ov.casl b/as/cmd/SLA/sla_ov.casl new file mode 100644 index 0000000..d5aee00 --- /dev/null +++ b/as/cmd/SLA/sla_ov.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,#C000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SLA/sla_s.casl b/as/cmd/SLA/sla_s.casl new file mode 100644 index 0000000..440cacc --- /dev/null +++ b/as/cmd/SLA/sla_s.casl @@ -0,0 +1,5 @@ +SLA2 START BEGIN +BEGIN LAD GR1,#8000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SLA/sla_so.casl b/as/cmd/SLA/sla_so.casl new file mode 100644 index 0000000..d5aee00 --- /dev/null +++ b/as/cmd/SLA/sla_so.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,#C000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SRA/sra_1.casl b/as/cmd/SRA/sra_1.casl new file mode 100644 index 0000000..ce1fee4 --- /dev/null +++ b/as/cmd/SRA/sra_1.casl @@ -0,0 +1,6 @@ +;;; SRA r,adr +MAIN START + LAD GR1,12 + SRA GR1,2 + RET + END diff --git a/as/cmd/SRA/sra_m.casl b/as/cmd/SRA/sra_m.casl new file mode 100644 index 0000000..1a5e0c3 --- /dev/null +++ b/as/cmd/SRA/sra_m.casl @@ -0,0 +1,5 @@ +SLA2 START BEGIN +BEGIN LAD GR1,#FFFD + SLA GR1,2 + RET + END diff --git a/as/cmd/SRA/sra_o.casl b/as/cmd/SRA/sra_o.casl new file mode 100644 index 0000000..ab7aac9 --- /dev/null +++ b/as/cmd/SRA/sra_o.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,#4000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SRA/sra_ov.casl b/as/cmd/SRA/sra_ov.casl new file mode 100644 index 0000000..d5aee00 --- /dev/null +++ b/as/cmd/SRA/sra_ov.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,#C000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SRA/sra_s.casl b/as/cmd/SRA/sra_s.casl new file mode 100644 index 0000000..440cacc --- /dev/null +++ b/as/cmd/SRA/sra_s.casl @@ -0,0 +1,5 @@ +SLA2 START BEGIN +BEGIN LAD GR1,#8000 + SLA GR1,1 + RET + END diff --git a/as/cmd/SRA/sra_so.casl b/as/cmd/SRA/sra_so.casl new file mode 100644 index 0000000..d5aee00 --- /dev/null +++ b/as/cmd/SRA/sra_so.casl @@ -0,0 +1,5 @@ +MAIN START + LAD GR1,#C000 + SLA GR1,1 + RET + END diff --git a/as/cmd/XOR/literal_spc.casl b/as/cmd/XOR/literal_spc.casl deleted file mode 100644 index 7c98d7b..0000000 --- a/as/cmd/XOR/literal_spc.casl +++ /dev/null @@ -1,9 +0,0 @@ -; リテラルに「=' '」を指定 -MAIN START - LD GR1,=' ' - ST GR1,BUF - OUT BUF,LEN - RET -BUF DS 1 -LEN DC 1 - END diff --git a/as/cmd/XOR/xor0.casl b/as/cmd/XOR/xor0.casl index ced17dd..1896735 100644 --- a/as/cmd/XOR/xor0.casl +++ b/as/cmd/XOR/xor0.casl @@ -1,8 +1,8 @@ -MAIN START -BEGIN LD GR1,A - LD GR2,A - XOR GR1,GR2 - RET -A DC #8001 -B DC #3521 - END +;;; XOR r,adr +MAIN START + LD GR1,A + XOR GR1,B + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/cmd/XOR/xor0_s.casl b/as/cmd/XOR/xor0_s.casl new file mode 100644 index 0000000..31ccb2a --- /dev/null +++ b/as/cmd/XOR/xor0_s.casl @@ -0,0 +1,8 @@ +;;; XOR r,adr 演算結果の符号が負 +MAIN START + LD GR1,A + XOR GR1,B + RET +A DC #8000 +B DC #FFFF + END diff --git a/as/cmd/XOR/xor0_z.casl b/as/cmd/XOR/xor0_z.casl new file mode 100644 index 0000000..5a747bd --- /dev/null +++ b/as/cmd/XOR/xor0_z.casl @@ -0,0 +1,8 @@ +;;; XOR r,adr 演算結果が零 +MAIN START + LD GR1,A + XOR GR1,B + RET +A DC #0001 +B DC #FFFE + END diff --git a/as/cmd/XOR/xor1.casl b/as/cmd/XOR/xor1.casl index a587fab..dc52edd 100644 --- a/as/cmd/XOR/xor1.casl +++ b/as/cmd/XOR/xor1.casl @@ -1,7 +1,8 @@ -MAIN START -BEGIN LAD GR0,#3444 - LD GR1,A - XOR GR0,A - RET -A DC #00DD - END +;;; XOR r,adr +MAIN START + LD GR1,A + XOR GR1,1,A + RET +A DC #3000 + DC #4FFF + END diff --git a/as/cmd/XOR/xor2.casl b/as/cmd/XOR/xor2.casl new file mode 100644 index 0000000..fc95b85 --- /dev/null +++ b/as/cmd/XOR/xor2.casl @@ -0,0 +1,9 @@ +;;; XOR r1,r2 +MAIN START + LD GR1,A + LD GR2,B + XOR GR1,GR2 + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/cmd/XOR/xor5.casl b/as/cmd/XOR/xor2_clear.casl similarity index 56% rename from as/cmd/XOR/xor5.casl rename to as/cmd/XOR/xor2_clear.casl index 0d5e346..ff454dd 100644 --- a/as/cmd/XOR/xor5.casl +++ b/as/cmd/XOR/xor2_clear.casl @@ -1,7 +1,7 @@ +;;; XOR r,r rの内容をクリア MAIN START BEGIN LD GR1,A - XOR GR1,B + XOR GR1,GR1 RET A DC 3 -B DC #FFFF END diff --git a/as/cmd/XOR/xor3.casl b/as/cmd/XOR/xor3.casl deleted file mode 100644 index 7b6e7cd..0000000 --- a/as/cmd/XOR/xor3.casl +++ /dev/null @@ -1,7 +0,0 @@ -MAIN START -BEGIN LAD GR0,#3444 - LD GR1,A - XOR GR0,A - RET -A DC #00DD - END diff --git a/as/cmd/XOR/xor4.casl b/as/cmd/XOR/xor4.casl deleted file mode 100644 index 845043d..0000000 --- a/as/cmd/XOR/xor4.casl +++ /dev/null @@ -1,13 +0,0 @@ -;;; XORで、GR1の内容をクリア -MAIN START -BEGIN XOR GR2,GR2 -LOOP CPA GR2,LEN - JZE FIN - LD GR1,A,GR2 - XOR GR1,GR1 - LAD GR2,1,GR2 - JUMP LOOP -FIN RET -A DC #8001,#8000,#FFFF,#51,#7FFF -LEN DC 5 - END diff --git a/as/cmd/IN/in_out.casl b/as/misc/in_out.casl similarity index 100% rename from as/cmd/IN/in_out.casl rename to as/misc/in_out.casl diff --git a/src/token.c b/src/token.c index 54ebf3f..2757a7b 100644 --- a/src/token.c +++ b/src/token.c @@ -6,7 +6,7 @@ OPD *opdtok(const char *str) { OPD *opd = malloc(sizeof(OPD)); char *p, *q, *sepp; - int sepc = ',', len; + int sepc = ',', len = 0; bool quoting = false; opd->opdc = 0; @@ -15,7 +15,6 @@ OPD *opdtok(const char *str) } p = q = strdup(str); do { - len = 0; /* オペランド数が多すぎる場合はエラー */ if(opd->opdc >= OPDSIZE) { setcerr(117, str); /* operand is too many */ diff --git a/test/integration/casl2/cmd_err0/0.txt b/test/integration/casl2/cmd_err0/0.txt index 711c1da..fd2ff24 100644 --- a/test/integration/casl2/cmd_err0/0.txt +++ b/test/integration/casl2/cmd_err0/0.txt @@ -6,5 +6,4 @@ Assemble ../../../../as/ERR/cmd_err0.casl (0) ../../../../as/ERR/cmd_err0.casl: 3: LAD GR2,2 ../../../../as/ERR/cmd_err0.casl: 4: LEA GR1,GR2 Assemble error - 109: LEA: not command of operand "r1,r2" - ../../../../as/ERR/cmd_err0.casl:4: LEA GR1,GR2 - +../../../../as/ERR/cmd_err0.casl: 4: LEA GR1,GR2 diff --git a/test/integration/casl2/cmd_err1/0.txt b/test/integration/casl2/cmd_err1/0.txt index 0c5569a..56921a4 100644 --- a/test/integration/casl2/cmd_err1/0.txt +++ b/test/integration/casl2/cmd_err1/0.txt @@ -4,5 +4,4 @@ Assemble ../../../../as/ERR/cmd_err1.casl (0) ../../../../as/ERR/cmd_err1.casl: 1:MAIN START BEGIN ../../../../as/ERR/cmd_err1.casl: 2:BEGIN LEA GR1,A Assemble error - 110: LEA: not command of operand "r,adr[,x]" - ../../../../as/ERR/cmd_err1.casl:2: BEGIN LEA GR1,A - +../../../../as/ERR/cmd_err1.casl: 2:BEGIN LEA GR1,A diff --git a/test/integration/casl2/ds_err/0.txt b/test/integration/casl2/ds_err/0.txt new file mode 100644 index 0000000..211dc12 --- /dev/null +++ b/test/integration/casl2/ds_err/0.txt @@ -0,0 +1,9 @@ +../../../../casl2 -slatd ../../../../as/ERR/ds_err.casl + +Assemble ../../../../as/ERR/ds_err.casl (0) +../../../../as/ERR/ds_err.casl: 1:MAIN START +../../../../as/ERR/ds_err.casl: 2: LAD GR0,=10 +../../../../as/ERR/ds_err.casl: 3: ST GR0,A +../../../../as/ERR/ds_err.casl: 4:A DS +Assemble error - 106: operand count mismatch +../../../../as/ERR/ds_err.casl: 4:A DS diff --git a/test/integration/casl2/labeldup_err/0.txt b/test/integration/casl2/labeldup_err/0.txt index ea2931f..9725887 100644 --- a/test/integration/casl2/labeldup_err/0.txt +++ b/test/integration/casl2/labeldup_err/0.txt @@ -8,5 +8,4 @@ Assemble ../../../../as/ERR/labeldup_err.casl (0) ../../../../as/ERR/labeldup_err.casl: 5:A DC 3 ../../../../as/ERR/labeldup_err.casl: 6:A DC 1 Assemble error - 101: A: label already defined - ../../../../as/ERR/labeldup_err.casl:6: A DC 1 - +../../../../as/ERR/labeldup_err.casl: 6:A DC 1 diff --git a/test/integration/casl2/literalstr_err/0.txt b/test/integration/casl2/literalstr_err/0.txt index 755d174..d84ce53 100644 --- a/test/integration/casl2/literalstr_err/0.txt +++ b/test/integration/casl2/literalstr_err/0.txt @@ -2,5 +2,4 @@ Assemble ../../../../as/ERR/literalstr_err.casl (0) Assemble error - 124: 'abcdeABCDE': more than one character in literal - ../../../../as/ERR/literalstr_err.casl:2: LAD GR1,='abcdeABCDE' - +../../../../as/ERR/literalstr_err.casl: 2: LAD GR1,='abcdeABCDE' diff --git a/test/integration/casl2/opdspc_err/0.txt b/test/integration/casl2/opdspc_err/0.txt index e1a99b5..fca7140 100644 --- a/test/integration/casl2/opdspc_err/0.txt +++ b/test/integration/casl2/opdspc_err/0.txt @@ -4,5 +4,4 @@ Assemble ../../../../as/ERR/opdspc_err.casl (0) ../../../../as/ERR/opdspc_err.casl: 1:MAIN START BEGIN ../../../../as/ERR/opdspc_err.casl: 2:BEGIN LD GR1, A Assemble error - 121: cannot get operand token - ../../../../as/ERR/opdspc_err.casl:2: BEGIN LD GR1, A - +../../../../as/ERR/opdspc_err.casl: 2:BEGIN LD GR1, A diff --git a/test/integration/casl2/quoteend_err/0.txt b/test/integration/casl2/quoteend_err/0.txt index 8c19446..53e03fe 100644 --- a/test/integration/casl2/quoteend_err/0.txt +++ b/test/integration/casl2/quoteend_err/0.txt @@ -2,5 +2,4 @@ Assemble ../../../../as/ERR/quoteend_err.casl (0) Assemble error - 123: 'Hello, World!: unclosed quote - ../../../../as/ERR/quoteend_err.casl:4: BUF DC 'Hello, World! - +../../../../as/ERR/quoteend_err.casl: 4:BUF DC 'Hello, World!