From: j8takagi Date: Sun, 7 Feb 2010 09:40:14 +0000 (+0900) Subject: masterブランチをマージ X-Git-Tag: v0.1~47^2~16 X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=commitdiff_plain;h=4fe8479d27f535a0ff44c9f6ce270249934e980f;hp=bbc3d71fec11bbd5654a04719436135035835ba3 masterブランチをマージ 次の競合は、すべて破棄 Conflicts: test/integration/casl2/misc_out_hello/0.txt test/integration/comet2/svc2_out/a.o --- diff --git a/as/CMD/adda0.casl b/as/CMD/adda0.casl deleted file mode 100644 index 8e068bc..0000000 --- a/as/CMD/adda0.casl +++ /dev/null @@ -1,6 +0,0 @@ -MAIN START -BEGIN LAD GR1,3 - ADDA GR1,A - RET -A DC 1 - END diff --git a/as/CMD/adda_overflow.casl b/as/CMD/adda_overflow.casl deleted file mode 100644 index 478cd3a..0000000 --- a/as/CMD/adda_overflow.casl +++ /dev/null @@ -1,6 +0,0 @@ -MAIN START BEGIN -BEGIN LAD GR1,32766 - ADDA GR1,A - RET -A DC 29 - END diff --git a/as/CMD/addl.casl b/as/CMD/addl.casl deleted file mode 100644 index d496648..0000000 --- a/as/CMD/addl.casl +++ /dev/null @@ -1,9 +0,0 @@ -MAIN START BEGIN -BEGIN LD GR0,A - ADDL GR0,B - ST GR0,C - RET -A DC 32766 -B DC 29 -C DS 1 - END diff --git a/as/CMD/addl_overflow.casl b/as/CMD/addl_overflow.casl deleted file mode 100644 index 5a6f7c9..0000000 --- a/as/CMD/addl_overflow.casl +++ /dev/null @@ -1,11 +0,0 @@ -MAIN START BEGIN -BEGIN LD GR1,A - ADDL GR1,B - ADDL GR1,C - ADDL GR1,D - RET -A DC 32765 -B DC 4 -C DC 32764 -D DC 7 - END diff --git a/as/CMD/and0.casl b/as/CMD/and0.casl deleted file mode 100644 index 99ca479..0000000 --- a/as/CMD/and0.casl +++ /dev/null @@ -1,6 +0,0 @@ -MAIN START -BEGIN LAD GR1,#8001 - LAD GR2,#3521 - AND GR1,GR2 - RET - END diff --git a/as/CMD/and1.casl b/as/CMD/and1.casl deleted file mode 100644 index 99b3203..0000000 --- a/as/CMD/and1.casl +++ /dev/null @@ -1,6 +0,0 @@ -MAIN START -BEGIN LAD GR0,#3444 - AND GR0,A - RET -A DC #00DD - END diff --git a/as/CMD/and2.casl b/as/CMD/and2.casl deleted file mode 100644 index 65b8b8a..0000000 --- a/as/CMD/and2.casl +++ /dev/null @@ -1,5 +0,0 @@ -MAIN START -BEGIN LAD GR0,#3444 - AND GR0,=#00DD - RET - END diff --git a/as/CMD/and3.casl b/as/CMD/and3.casl deleted file mode 100644 index 2e6cf33..0000000 --- a/as/CMD/and3.casl +++ /dev/null @@ -1,5 +0,0 @@ -MAIN START -BEGIN LAD GR0,#0460 - AND GR0,=#00FF - RET - END diff --git a/as/CMD/literal_spc.casl b/as/CMD/literal_spc.casl deleted file mode 100644 index 3c034d4..0000000 --- a/as/CMD/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/FUNC/addl32.casl b/as/FUNC/addl32.casl deleted file mode 100644 index 63a6bba..0000000 --- a/as/FUNC/addl32.casl +++ /dev/null @@ -1,22 +0,0 @@ -;;; 2つの32ビット数値を加算する -;;; 32ビットの値は、連続する2語の領域に格納 -MAIN START BEGIN -BEGIN LAD GR1,1 ; GR1にAの下位語を転送 - LD GR1,A,GR1 ; ↓ - LAD GR2,1 ; GR2にBの下位語を転送 - LD GR2,B,GR2 ; ↓ - ADDL GR1,GR2 ; GR1 <- GR1 + GR2 - JOV CARR ; オーバーフロー時は、CARRにジャンプ - JUMP STL -CARR LAD GR2,1 ; Cの上位語に1を格納 - ST GR2,C ; ↓ -STL LAD GR2,1 ; Cの下位語にGR1の内容を格納 - ST GR1,C,GR2 ; ↓ - LD GR1,A ; GR1にAの上位語を転送 - ADDL GR1,B ; GR1 <- GR1 + B - ADDL GR1,C ; GR1 <- GR1 + C - RET -A DC 0,65534 -B DC 0,65535 -C DS 2 - END diff --git a/as/FUNC/count1.casl b/as/FUNC/count1.casl deleted file mode 100644 index 41f8d57..0000000 --- a/as/FUNC/count1.casl +++ /dev/null @@ -1,18 +0,0 @@ -COUNT1 START -; 入力 GR1:検索する語 -; 処理 GR1中の'1'のビットの個数を求める -; 出力 GR0:GR1中の'1'のビットの個数 - PUSH 0,GR1 - PUSH 0,GR2 - SUBA GR2,GR2 - AND GR1,GR1 - JZE RETURN -MORE LAD GR2,1,GR2 - LAD GR0,-1,GR1 - AND GR1,GR0 - JNZ MORE -RETURN LD GR0,GR2 - POP GR2 - POP GR1 - RET - END diff --git a/as/FUNC/inl.casl b/as/FUNC/inl.casl deleted file mode 100644 index 8cb0a7a..0000000 --- a/as/FUNC/inl.casl +++ /dev/null @@ -1,60 +0,0 @@ -;;; 入力された数値をGR0で返す -INL START - RPUSH - IN IBUF,ILEN - LAD GR1,0 - LAD GR2,10 ; 10進数の「10」 - LAD GR3,0 ; 値の一時格納 - LAD GR4,0 ; インデックス -ISTOL CPL GR4,ILEN ; ループ先頭。(GR4 = ILEN)の場合、ループ脱出 - JZE ICP ; ↓ - LD GR1,IBUF,GR4 - CPL GR1,INCHR ; (GR1 < (INCHR = '0'))の場合、IOVへジャンプ - JMI IOV ; ↓ - CPL GR1,='9' ; (GR1 > '9')の場合、IOVへジャンプ - JPL IOV ; ↓ - SUBL GR1,INCHR - ST GR4,NLEN - LD GR4,ILEN - SUBA GR4,NLEN -MUL10 CPL GR4,=1 - JZE ISNEXT - CALL MULL - LD GR1,GR0 - LAD GR4,-1,GR4 - JUMP MUL10 -ISNEXT LD GR4,NLEN - ADDL GR3,GR1 - LAD GR4,1,GR4 - JUMP ISTOL ; ループ終端 -IOV LAD GR0,1 - ADDL GR0,=#FFFF - JUMP IFIN -ICP LD GR0,GR3 -IFIN RPOP - RET -INCHR DC '0123456789' -IBUF DS 5 -ILEN DS 1 -NLEN DS 1 - END -;GR1の値とGR2の値の積をGR0に格納 -MULL START - RPUSH - LAD GR3,1 ; 対象ビット - LAD GR0,0 ; 積 -MLOOP CPL GR3,GR2 ; ループ先頭。(GR2 = GR3)の場合、ループ脱出 - JPL MFIN ; ↓ - PUSH 0,GR3 ; GR2の、GR3が示したビットが0の場合、MNEXTへジャンプ - AND GR3,GR2 ; ↓ - POP GR3 ; ↓ - JZE MNEXT ; ↓ - ADDL GR0,GR1 ; GR0 <- GR0 + GR1 - JOV MFIN ; オーバーフローした場合、ループ脱出 -MNEXT SLL GR3,1 ; GR3を1回左シフト - SLL GR1,1 ; GR1を1回左シフト - JOV MFIN ; オーバーフローした場合、ループ脱出 - JUMP MLOOP ; ループ終端 -MFIN RPOP - RET - END diff --git a/as/FUNC/mula1.casl b/as/FUNC/mula1.casl deleted file mode 100644 index 8633b15..0000000 --- a/as/FUNC/mula1.casl +++ /dev/null @@ -1,49 +0,0 @@ -;;; -32767〜32767の範囲にある正数のかけ算(筆算方式)を行う -;;; 入力 GR1:被乗数 GR2:乗数 -;;; 出力 GR0:積 -;;; 被乗数または乗数が-32768の場合は、オーバーフロー -;;; 積が-32767未満または32767より大きい場合は、GR0は積の下位16ビットになり、オーバーフロー -MULA START - RPUSH - XOR GR0,GR0 ; 積 - AND GR1,GR1 ; (GR1 = 0)の場合、終了 - JZE FIN ; ↓ - AND GR2,GR2 ; (GR2 = 0)の場合、終了 - JZE FIN ; ↓ - LAD GR3,1 ; 対象ビット - XOR GR4,GR4 ; マイナスフラグ -CHK1 AND GR1,GR1 ; (GR1 > 0)の場合は、CHK2へジャンプ - JPL CHK2 ; ↓ - XOR GR1,ALLON ; GR1の正負を反転 - ADDA GR1,ONE ; ↓ - JOV FIN ; (GR1 = -32768)の場合は終了 - XOR GR4,ONE ; GR4 <- 1 -CHK2 AND GR2,GR2 ; (GR1 > 0)の場合は、LOOPへジャンプ - JPL LOOP ; ↓ - XOR GR2,ALLON ; GR2の正負を反転 - ADDA GR2,ONE ; ↓ - JOV FIN ; (GR2 = -32768)の場合は終了 - XOR GR4,ONE ; マイナスフラグを反転 -LOOP PUSH 0,GR3 ; ループ先頭。GR2のビット中でGR3の示したものが0の場合、NEXTへジャンプ - AND GR3,GR2 ; ↓ - POP GR3 ; ↓ - JZE NEXT ; ↓ - ADDA GR0,GR1 ; GR0 <- GR0 + GR1 - JOV FIN ; オーバーフローした場合、終了 -NEXT SLA GR3,1 ; GR3を1回左シフト - AND GR3,GR3 ; (GR3 = 0)の場合、ループ脱出 - JZE MIN ; ↓ - CPL GR3,GR2 ; (GR3 > GR2)の場合、ループ脱出 - JPL MIN ; ↓ - SLA GR1,1 ; GR1を1回左シフト - JOV FIN ; オーバーフローした場合、終了 - JUMP LOOP ; ループ終端 -MIN AND GR4,GR4 ; マイナスフラグがオフの場合、終了 - JZE FIN ; ↓ - XOR GR0,ALLON ; GR1の正負を反転 - ADDA GR0,ONE ; ↓ -FIN RPOP - RET -ONE DC 1 -ALLON DC #FFFF - END diff --git a/as/FUNC/outa0.casl b/as/FUNC/outa0.casl deleted file mode 100644 index 1087f6c..0000000 --- a/as/FUNC/outa0.casl +++ /dev/null @@ -1,103 +0,0 @@ -;;; GR1に格納された値を、10進数の整数値(-32768〜32767)として表示 -OUTA START - RPUSH - LAD GR2,10 ; GR2に10進数の「10」を格納。 - LAD GR0,0 ; GR0 <- 0 - LAD GR4,0 ; 負数フラグ。GR1が負数の場合、GR4は1 - ST GR0,LEN ; LENの初期化 - AND GR1,GR1 ; GR1をテスト - JZE ZPRT ; GR1が0の場合、ZPRTにジャンプ - JPL STI ; GR1が正数の場合、STIにジャンプ - LAD GR4,1 ; GR1が負数の場合、GR4をオン - CALL OABS ; GR1を正数に変換 -STI CPL GR1,GR2 ; ループ先頭。(GR1 < GR2)の場合は、ループ脱出 - JMI STLST ; ↓ - CALL ODIVL ; GR1とGR2の、商をGR0、剰余をGR3に格納 - LD GR1,GR3 ; GR1にGR3をコピー - LD GR1,NCHAR,GR1 ; GR1を文字に変換 - CALL STSTR ; GR1をSTR領域に格納 - LD GR1,GR0 ; GR0をGR1にコピー - JUMP STI ; ループ終端 -STLST LD GR1,NCHAR,GR1 ; GR1を文字に変換 - CALL STSTR ; GR1をSTR領域に格納 - AND GR4,GR4 ; 正数の場合 - JZE PRT ; ↓ - LD GR1,='-' ; 負数の場合、「-」をSTR領域に格納 - CALL STSTR ; ↓ - JUMP PRT ; PRTにジャンプ -ZPRT LD GR1,NCHAR ; 「0」をSTR領域に格納 - CALL STSTR ; ↓ -PRT LD GR2,LEN ; GR2にLENの値を格納 - LAD GR1,STR ; GR1に文字列のアドレスを格納 - CALL REV ; 文字列を逆順に並べ替え - OUT STR,LEN ; 文字列を出力 - RPOP - RET -STR DS 17 -LEN DS 1 -NCHAR DC '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' - END -;; GR1をSTR領域に格納し、LENをインクリメント -STSTR START - PUSH 0,GR1 - PUSH 0,GR2 - LD GR2,LEN ; GR2にLENの値をロード - ST GR1,STR,GR2 ; STR+GR2 <- GR1 - LAD GR2,1,GR2 ; GR2 <- GR2 + 1 - ST GR2,LEN ; LENにGR2を格納 - POP GR2 - POP GR1 - RET - END -;;; GR1の値とGR2の値の、商をGR0、剰余をGR3に格納する -;;; 0〜65535の範囲の数値を扱う -ODIVL START - PUSH 0,GR1 - AND GR2,GR2 ; (GR2 = 0)の場合、ODYZへジャンプ - JZE ODYZ ; ↓ - LAD GR0,0 ; GR0を初期化 - LD GR3,GR1 ; GR3 <- GR1 -ODLOOP CPL GR3,GR2 ; ループ先頭。(GR3 < GR2)の場合、終了 - JMI ODFIN ; ↓ - SUBL GR3,GR2 ; GR3 <- GR3 - GR2 - ADDL GR0,ODONE ; ↓ - JUMP ODLOOP ; ループ終端 -ODYZ LAD GR3,#FFFF ; 強制的にオーバーフローを発生させ、GR3 <- 0 - ADDL GR3,=1 ; ↓ - JUMP ODFIN ; ODFINへジャンプ -ODFIN POP GR1 - RET -ODONE DC 1 - END -;; アドレスがGR1、長さがGR2の文字列を逆順に並べ替える -;; 例: 12345 -> 54321、54321- -> -12345 -REV START - RPUSH - LAD GR3,0 ; GR3の初期化 -RPU CPL GR3,GR2 ; ループ先頭。(GR3 = GR2)の場合、ループ脱出 - JZE RNEXT ; ↓ - LD GR4,GR1 ; GR4にGR1の値をコピー - ADDL GR4,GR3 ; GR4 <- GR4 + GR3 - LD GR5,0,GR4 ; GR5にアドレスGR4の値を格納 - PUSH 0,GR5 ; GR5をプッシュ - LAD GR3,1,GR3 ; GR3 <- GR3 + 1 - JUMP RPU ; ループ終端 -RNEXT LAD GR3,0 ; GR3の初期化 -RPO CPL GR3,GR2 ; ループ先頭。(GR3 = GR2)の場合、ループ脱出 - JZE RFIN ; ↓ - POP GR5 ; GR5にポップ - LD GR4,GR1 ; GR4にGR1の値をコピー - ADDL GR4,GR3 ; GR4 <- GR4 + GR3 - ST GR5,0,GR4 ; アドレスGR4にGR5の値を格納 - LAD GR3,1,GR3 ; GR3 <- GR3 + 1 - JUMP RPO ; ループ終端 -RFIN RPOP - RET - END -;; GR1の値を絶対値に変換する。GR1にはマイナスの数値が格納されていると想定。 -;; 例: -10 -> 10, -20 -> 20 -OABS START - XOR GR1,=#FFFF ; GR1の値を反転 - LAD GR1,1,GR1 ; GR1 <- GR1 + 1 - RET - END diff --git a/as/FUNC/sum.casl b/as/FUNC/sum.casl deleted file mode 100644 index b9bfe11..0000000 --- a/as/FUNC/sum.casl +++ /dev/null @@ -1,16 +0,0 @@ -;;; sum.casl -;;; 入力 GR1: 1以上の正数 -;;; 出力 GR2: 1からGR1で指定された値までの正数をすべて加算した値。 -;;; オーバーフローした場合は、#FFFF -SUM START - LAD GR2,0 - LAD GR3,1 -LOOP CPL GR3,GR1 - JPL FIN - ADDL GR2,GR3 - JOV OV - LAD GR3,1,GR3 - JUMP LOOP -OV LAD GR2,#FFFF -FIN RET - END diff --git a/as/FUNC/Makefile b/as/casl2lib/Makefile similarity index 79% rename from as/FUNC/Makefile rename to as/casl2lib/Makefile index fb93443..cb6ecff 100644 --- a/as/FUNC/Makefile +++ b/as/casl2lib/Makefile @@ -4,3 +4,5 @@ outa.casl: outa_main.casl divl1.casl rev.casl abs.casl cat $^ >$@ outb.casl: outb_main.casl divl1.casl rev.casl cat $^ >$@ +inl.casl: inl_main.casl mull1.casl + cat $^ >$@ diff --git a/as/FUNC/abs.casl b/as/casl2lib/abs.casl similarity index 100% rename from as/FUNC/abs.casl rename to as/casl2lib/abs.casl diff --git a/as/casl2lib/addl32.casl b/as/casl2lib/addl32.casl new file mode 100644 index 0000000..cfb5c1d --- /dev/null +++ b/as/casl2lib/addl32.casl @@ -0,0 +1,35 @@ +;;; 2つの32ビット数値を加算する +;;; 32ビットの値は、連続する2語の領域に格納 +;;; 入力 GR1:数値1の先頭アドレス GR2:数値2の先頭アドレス +;;; 出力 GR0:和の先頭アドレス +ADDL32 START + ST GR1,A + ST GR2,B + LD GR3,LEN ; GR3:語を表すインデックス 初期化 + LAD GR3,-1,GR3 ; ↓ +LOOP AND GR3,GR3 ; ループ先頭。(GR3 = 0)の場合は、ループ脱出 + JMI FIN ; ↓ + LD GR1,GR3 ; GR1 <- (A + GR3)の値 + ADDL GR1,A ; ↓ + LD GR1,0,GR1 ; ↓ + LD GR2,GR3 ; GR2 <- (B + GR3)の値 + ADDL GR2,B ; ↓ + LD GR2,0,GR2 ; ↓ + ADDL GR1,GR2 ; GR1 <- GR1 + GR2 + ST GR1,C,GR3 ; (C + GR3) <- GR1(フラグ不変) + LAD GR3,-1,GR3 ; GR3 <- GR3 - 1(フラグ不変) + JOV CRRY ; オーバーフロー時は、CRRYへジャンプ + XOR GR1,GR1 ; GR1 <- 0 + JUMP LOOP ; ループ先頭へジャンプ +CRRY AND GR3,GR3 ; 最上位の語でオーバーフローした場合 + JZE OV ; ↓OVへジャンプ + LAD GR1,1 ; GR1 <- 1 + JUMP LOOP ; ループ終端 +OV ADDL GR1,=#FFFF ; 強制的にオーバーフロー発生 +FIN LAD GR0,C ; GR3 <- C + RET +A DS 1 ; 数値1のアドレス +B DS 1 ; 数値2のアドレス +C DS 2 ; 和 +LEN DC 2 ; 数値の語数 + END diff --git a/as/FUNC/diva1.casl b/as/casl2lib/diva1.casl similarity index 100% rename from as/FUNC/diva1.casl rename to as/casl2lib/diva1.casl diff --git a/as/FUNC/divl1.casl b/as/casl2lib/divl1.casl similarity index 100% rename from as/FUNC/divl1.casl rename to as/casl2lib/divl1.casl diff --git a/as/casl2lib/inl.casl b/as/casl2lib/inl.casl new file mode 100644 index 0000000..aa9c6f8 --- /dev/null +++ b/as/casl2lib/inl.casl @@ -0,0 +1,73 @@ +;;; 入力された数値をGR0に格納する +INL START + RPUSH + IN IBUF,ILEN ; 入力文字列を格納 + XOR GR1,GR1 ; GR1:各桁の数値 初期化 + LAD GR2,10 ; GR2:10進数の「10」 初期化 + LAD GR3,0 ; GR3:値の一時格納 初期化 + LAD GR4,0 ; GR4:インデックス 初期化 +STOL CPL GR4,ILEN ; ループ先頭。(GR4 = ILEN)の場合、ループ脱出 + JZE CP ; ↓ + LD GR1,IBUF,GR4 ; GR1に、入力文字列中の次の桁を格納 + CPL GR1,ZERO ; (GR1 < '0')の場合、IOVへジャンプ + JMI OV ; ↓ + CPL GR1,NINE ; (GR1 > '9')の場合、IOVへジャンプ + JPL OV ; ↓ + SUBL GR1,ZERO ; GR1の文字を、対応する数値に変換 + ST GR4,NLEN ; GR4 <- ILEN - NLEN - 1 + LD GR4,ILEN ; ↓ + SUBA GR4,NLEN ; ↓ +MUL10 CPA GR4,=1 ; ループ先頭。GR1 <- 10 ** GR4 + JZE NEXT ; (GR4 = 1)の場合、ループ脱出 + JMI NEXT ; ↓ + CALL MULL ; MULLを呼び出し、GR0 <- GR1 * GR2 + LD GR1,GR0 ; GR1 <- GR0 + LAD GR4,-1,GR4 ; GR4 <- GR4 -1 + JUMP MUL10 ; ループ終端 +NEXT LD GR4,NLEN ; GR4 <- NLEN。復元 + ADDL GR3,GR1 ; GR3 <- GR3 + GR1 + LAD GR4,1,GR4 ; GR4 <- GR4 + 1 + JUMP STOL ; ループ終端 +OV LAD GR0,1 ; GR0 <- 0。オーバーフローを強制的に発生させる + ADDL GR0,=#FFFF ; ↓ + JUMP FIN ; FINへジャンプ +CP LD GR0,GR3 ; GR0 <- GR3 +FIN RPOP + RET +ZERO DC '0' +NINE DC '9' +IBUF DS 5 +ILEN DS 1 +NLEN DS 1 + END +;;; 0〜65535の範囲にある正数のかけ算(筆算方式)を行う +;;; 入力 GR1:被乗数 GR2:乗数 +;;; 出力 GR0:積 +;;; 積が65535より大きい場合は、GR0は積の下位16ビットになり、オーバーフロー +MULL START + PUSH 0,GR1 + PUSH 0,GR3 + XOR GR0,GR0 ; 積 + AND GR1,GR1 ; (GR1 = 0)の場合、終了 + JZE FIN ; ↓ + AND GR2,GR2 ; (GR2 = 0)の場合、終了 + JZE FIN ; ↓ + LAD GR3,1 ; 対象ビット +LOOP PUSH 0,GR3 ; ループ先頭。GR2のビット中でGR3が示すビットが0の場合、NEXTへジャンプ + AND GR3,GR2 ; ↓ + POP GR3 ; ↓ + JZE NEXT ; ↓ + ADDL GR0,GR1 ; GR0 <- GR0 + GR1 + JOV FIN ; GR0がオーバーフローした場合、ループ脱出 +NEXT SLL GR3,1 ; GR3を1回左シフト + AND GR3,GR3 ; (GR3 = 0)の場合、ループ脱出 + JZE FIN ; ↓ + CPL GR3,GR2 ; (GR3 > GR2)の場合、ループ脱出 + JPL FIN ; ↓ + SLL GR1,1 ; GR1を1回左シフト + JOV FIN ; GR1がオーバーフローした場合、ループ脱出 + JUMP LOOP ; ループ終端 +FIN POP GR3 + POP GR1 + RET + END diff --git a/as/casl2lib/inl_main.casl b/as/casl2lib/inl_main.casl new file mode 100644 index 0000000..40770ed --- /dev/null +++ b/as/casl2lib/inl_main.casl @@ -0,0 +1,42 @@ +;;; 入力された数値をGR0に格納する +INL START + RPUSH + IN IBUF,ILEN ; 入力文字列を格納 + XOR GR1,GR1 ; GR1:各桁の数値 初期化 + LAD GR2,10 ; GR2:10進数の「10」 初期化 + LAD GR3,0 ; GR3:値の一時格納 初期化 + LAD GR4,0 ; GR4:インデックス 初期化 +STOL CPL GR4,ILEN ; ループ先頭。(GR4 = ILEN)の場合、ループ脱出 + JZE CP ; ↓ + LD GR1,IBUF,GR4 ; GR1に、入力文字列中の次の桁を格納 + CPL GR1,ZERO ; (GR1 < '0')の場合、IOVへジャンプ + JMI OV ; ↓ + CPL GR1,NINE ; (GR1 > '9')の場合、IOVへジャンプ + JPL OV ; ↓ + SUBL GR1,ZERO ; GR1の文字を、対応する数値に変換 + ST GR4,NLEN ; GR4 <- ILEN - NLEN - 1 + LD GR4,ILEN ; ↓ + SUBA GR4,NLEN ; ↓ +MUL10 CPA GR4,=1 ; ループ先頭。GR1 <- 10 ** GR4 + JZE NEXT ; (GR4 = 1)の場合、ループ脱出 + JMI NEXT ; ↓ + CALL MULL ; MULLを呼び出し、GR0 <- GR1 * GR2 + LD GR1,GR0 ; GR1 <- GR0 + LAD GR4,-1,GR4 ; GR4 <- GR4 -1 + JUMP MUL10 ; ループ終端 +NEXT LD GR4,NLEN ; GR4 <- NLEN。復元 + ADDL GR3,GR1 ; GR3 <- GR3 + GR1 + LAD GR4,1,GR4 ; GR4 <- GR4 + 1 + JUMP STOL ; ループ終端 +OV LAD GR0,1 ; GR0 <- 0。オーバーフローを強制的に発生させる + ADDL GR0,=#FFFF ; ↓ + JUMP FIN ; FINへジャンプ +CP LD GR0,GR3 ; GR0 <- GR3 +FIN RPOP + RET +ZERO DC '0' +NINE DC '9' +IBUF DS 5 +ILEN DS 1 +NLEN DS 1 + END diff --git a/as/FUNC/minim.casl b/as/casl2lib/minim.casl similarity index 60% rename from as/FUNC/minim.casl rename to as/casl2lib/minim.casl index f1198da..32ff6c0 100644 --- a/as/FUNC/minim.casl +++ b/as/casl2lib/minim.casl @@ -1,10 +1,13 @@ -;;; GR1のアドレスに格納されたGR2の個数の値の中で、最小値をGR0に格納する +;;; 複数のWORD値の中から、最小値を返す +;;; 入力: GR1: WORD値を格納したアドレス GR2: 値の個数 +;;; 出力: GR0: 最小値 MINIM START + RPUSH LD GR0,0,GR1 ST GR0,MIN LAD GR3,0 S1 CPA GR3,GR2 - JZE LRET + JZE RET LAD GR1,1,GR1 LD GR0,0,GR1 CPA GR0,MIN @@ -13,7 +16,8 @@ S1 CPA GR3,GR2 ST GR0,MIN S2 LAD GR3,1,GR3 JUMP S1 -LRET LD GR0,MIN +RET LD GR0,MIN + RPOP RET MIN DS 1 END diff --git a/as/FUNC/mula2.casl b/as/casl2lib/mula.casl similarity index 100% rename from as/FUNC/mula2.casl rename to as/casl2lib/mula.casl diff --git a/as/FUNC/mull1.casl b/as/casl2lib/mull.casl similarity index 100% rename from as/FUNC/mull1.casl rename to as/casl2lib/mull.casl diff --git a/as/FUNC/outa.casl b/as/casl2lib/outa.casl similarity index 100% rename from as/FUNC/outa.casl rename to as/casl2lib/outa.casl diff --git a/as/FUNC/outa_main.casl b/as/casl2lib/outa_main.casl similarity index 100% rename from as/FUNC/outa_main.casl rename to as/casl2lib/outa_main.casl diff --git a/as/FUNC/outb.casl b/as/casl2lib/outb.casl similarity index 100% rename from as/FUNC/outb.casl rename to as/casl2lib/outb.casl diff --git a/as/FUNC/outb_main.casl b/as/casl2lib/outb_main.casl similarity index 100% rename from as/FUNC/outb_main.casl rename to as/casl2lib/outb_main.casl diff --git a/as/FUNC/outd_q15.casl b/as/casl2lib/outd_q15.casl similarity index 100% rename from as/FUNC/outd_q15.casl rename to as/casl2lib/outd_q15.casl diff --git a/as/FUNC/outl.casl b/as/casl2lib/outl.casl similarity index 100% rename from as/FUNC/outl.casl rename to as/casl2lib/outl.casl diff --git a/as/FUNC/outl_main.casl b/as/casl2lib/outl_main.casl similarity index 100% rename from as/FUNC/outl_main.casl rename to as/casl2lib/outl_main.casl diff --git a/as/FUNC/rev.casl b/as/casl2lib/rev.casl similarity index 100% rename from as/FUNC/rev.casl rename to as/casl2lib/rev.casl diff --git a/as/casl2lib/sum.casl b/as/casl2lib/sum.casl new file mode 100644 index 0000000..0121134 --- /dev/null +++ b/as/casl2lib/sum.casl @@ -0,0 +1,16 @@ +;;; sum.casl +;;; 入力 GR1: 1以上の正数 +;;; 出力 GR0: 1からGR1で指定された値までの正数をすべて加算した値。 +;;; オーバーフローした場合は、0 +SUM START + LAD GR0,0 + LAD GR2,1 +LOOP CPL GR2,GR1 + JPL FIN + ADDL GR0,GR2 + JOV OV + LAD GR2,1,GR2 + JUMP LOOP +OV LAD GR0,0 +FIN RET + END diff --git a/as/FUNC/abs_call.casl b/as/casl2lib_test/abs_call.casl similarity index 100% rename from as/FUNC/abs_call.casl rename to as/casl2lib_test/abs_call.casl diff --git a/as/FUNC/abs_call1.casl b/as/casl2lib_test/abs_call1.casl similarity index 100% rename from as/FUNC/abs_call1.casl rename to as/casl2lib_test/abs_call1.casl diff --git a/as/casl2lib_test/addl32_call.casl b/as/casl2lib_test/addl32_call.casl new file mode 100644 index 0000000..2b3b323 --- /dev/null +++ b/as/casl2lib_test/addl32_call.casl @@ -0,0 +1,9 @@ +MAIN START + LAD GR1,A + LAD GR2,B + CALL ADDL32 + RET +A DC 12,34 +B DC 10,32767 +C DS 2 + END diff --git a/as/FUNC/count1_call.casl b/as/casl2lib_test/count1_call.casl similarity index 100% rename from as/FUNC/count1_call.casl rename to as/casl2lib_test/count1_call.casl diff --git a/as/FUNC/count1_call0.casl b/as/casl2lib_test/count1_call0.casl similarity index 100% rename from as/FUNC/count1_call0.casl rename to as/casl2lib_test/count1_call0.casl diff --git a/as/FUNC/divl_call.casl b/as/casl2lib_test/divl_call.casl similarity index 100% rename from as/FUNC/divl_call.casl rename to as/casl2lib_test/divl_call.casl diff --git a/as/FUNC/divl_call0.casl b/as/casl2lib_test/divl_call0.casl similarity index 100% rename from as/FUNC/divl_call0.casl rename to as/casl2lib_test/divl_call0.casl diff --git a/as/FUNC/divl_call1.casl b/as/casl2lib_test/divl_call1.casl similarity index 100% rename from as/FUNC/divl_call1.casl rename to as/casl2lib_test/divl_call1.casl diff --git a/as/FUNC/inl_call.casl b/as/casl2lib_test/inl_call.casl similarity index 100% rename from as/FUNC/inl_call.casl rename to as/casl2lib_test/inl_call.casl diff --git a/as/FUNC/minim_call.casl b/as/casl2lib_test/minim_call.casl similarity index 100% rename from as/FUNC/minim_call.casl rename to as/casl2lib_test/minim_call.casl diff --git a/as/FUNC/mula_call.casl b/as/casl2lib_test/mula_call.casl similarity index 100% rename from as/FUNC/mula_call.casl rename to as/casl2lib_test/mula_call.casl diff --git a/as/FUNC/mula_call0.casl b/as/casl2lib_test/mula_call0.casl similarity index 100% rename from as/FUNC/mula_call0.casl rename to as/casl2lib_test/mula_call0.casl diff --git a/as/FUNC/mula_call1.casl b/as/casl2lib_test/mula_call1.casl similarity index 100% rename from as/FUNC/mula_call1.casl rename to as/casl2lib_test/mula_call1.casl diff --git a/as/FUNC/mula_call2.casl b/as/casl2lib_test/mula_call2.casl similarity index 100% rename from as/FUNC/mula_call2.casl rename to as/casl2lib_test/mula_call2.casl diff --git a/as/FUNC/mull_call.casl b/as/casl2lib_test/mull_call.casl similarity index 100% rename from as/FUNC/mull_call.casl rename to as/casl2lib_test/mull_call.casl diff --git a/as/FUNC/mull_call0.casl b/as/casl2lib_test/mull_call0.casl similarity index 100% rename from as/FUNC/mull_call0.casl rename to as/casl2lib_test/mull_call0.casl diff --git a/as/FUNC/mull_call1.casl b/as/casl2lib_test/mull_call1.casl similarity index 100% rename from as/FUNC/mull_call1.casl rename to as/casl2lib_test/mull_call1.casl diff --git a/as/FUNC/outa_call.casl b/as/casl2lib_test/outa_call.casl similarity index 100% rename from as/FUNC/outa_call.casl rename to as/casl2lib_test/outa_call.casl diff --git a/as/FUNC/outa_call1.casl b/as/casl2lib_test/outa_call1.casl similarity index 100% rename from as/FUNC/outa_call1.casl rename to as/casl2lib_test/outa_call1.casl diff --git a/as/FUNC/outa_call2.casl b/as/casl2lib_test/outa_call2.casl similarity index 100% rename from as/FUNC/outa_call2.casl rename to as/casl2lib_test/outa_call2.casl diff --git a/as/FUNC/outb_call.casl b/as/casl2lib_test/outb_call.casl similarity index 100% rename from as/FUNC/outb_call.casl rename to as/casl2lib_test/outb_call.casl diff --git a/as/FUNC/outd_q15_call.casl b/as/casl2lib_test/outd_q15_call.casl similarity index 100% rename from as/FUNC/outd_q15_call.casl rename to as/casl2lib_test/outd_q15_call.casl diff --git a/as/FUNC/outd_q15_call0.casl b/as/casl2lib_test/outd_q15_call0.casl similarity index 100% rename from as/FUNC/outd_q15_call0.casl rename to as/casl2lib_test/outd_q15_call0.casl diff --git a/as/FUNC/outl_call.casl b/as/casl2lib_test/outl_call.casl similarity index 100% rename from as/FUNC/outl_call.casl rename to as/casl2lib_test/outl_call.casl diff --git a/as/FUNC/outl_call0.casl b/as/casl2lib_test/outl_call0.casl similarity index 100% rename from as/FUNC/outl_call0.casl rename to as/casl2lib_test/outl_call0.casl diff --git a/as/FUNC/outl_call1.casl b/as/casl2lib_test/outl_call1.casl similarity index 100% rename from as/FUNC/outl_call1.casl rename to as/casl2lib_test/outl_call1.casl diff --git a/as/FUNC/outl_call2.casl b/as/casl2lib_test/outl_call2.casl similarity index 100% rename from as/FUNC/outl_call2.casl rename to as/casl2lib_test/outl_call2.casl diff --git a/as/FUNC/rev_call.casl b/as/casl2lib_test/rev_call.casl similarity index 100% rename from as/FUNC/rev_call.casl rename to as/casl2lib_test/rev_call.casl diff --git a/as/FUNC/sum_call.casl b/as/casl2lib_test/sum_call.casl similarity index 90% rename from as/FUNC/sum_call.casl rename to as/casl2lib_test/sum_call.casl index a983623..eea0111 100644 --- a/as/FUNC/sum_call.casl +++ b/as/casl2lib_test/sum_call.casl @@ -3,7 +3,7 @@ MAIN START LAD GR1,361 CALL SUM - LD GR1,GR2 + LD GR1,GR0 CALL OUTL MFIN RET END diff --git a/as/cmd/ADDA/adda0_0.casl b/as/cmd/ADDA/adda0_0.casl new file mode 100644 index 0000000..ec6f2f8 --- /dev/null +++ b/as/cmd/ADDA/adda0_0.casl @@ -0,0 +1,7 @@ +MAIN START +BEGIN LAD GR1,A + ADDA GR1,B + RET +A DC 3 +B DC 1 + END diff --git a/as/cmd/ADDA/adda0_ov0.casl b/as/cmd/ADDA/adda0_ov0.casl new file mode 100644 index 0000000..d0f5163 --- /dev/null +++ b/as/cmd/ADDA/adda0_ov0.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDA GR1,B + RET +A DC 32767 +B DC 10 + END diff --git a/as/cmd/ADDA/adda0_ov1.casl b/as/cmd/ADDA/adda0_ov1.casl new file mode 100644 index 0000000..b3a940e --- /dev/null +++ b/as/cmd/ADDA/adda0_ov1.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDA GR1,B + RET +A DC #8001 ; -32767 +B DC #FFF6 ; -10 + END diff --git a/as/cmd/ADDA/adda0_s0.casl b/as/cmd/ADDA/adda0_s0.casl new file mode 100644 index 0000000..3770d34 --- /dev/null +++ b/as/cmd/ADDA/adda0_s0.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDA GR1,B + RET +A DC 10 +B DC #FFEC ; -20 + END diff --git a/as/cmd/ADDA/adda0_s1.casl b/as/cmd/ADDA/adda0_s1.casl new file mode 100644 index 0000000..3b8fd4d --- /dev/null +++ b/as/cmd/ADDA/adda0_s1.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDA GR1,B + RET +A DC -10 +B DC 20 + END diff --git a/as/CMD/adda1.casl b/as/cmd/ADDA/adda1_0.casl similarity index 100% rename from as/CMD/adda1.casl rename to as/cmd/ADDA/adda1_0.casl diff --git a/as/cmd/ADDA/adda1_ov0.casl b/as/cmd/ADDA/adda1_ov0.casl new file mode 100644 index 0000000..1a38af5 --- /dev/null +++ b/as/cmd/ADDA/adda1_ov0.casl @@ -0,0 +1,8 @@ +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/adda1_ov1.casl b/as/cmd/ADDA/adda1_ov1.casl new file mode 100644 index 0000000..326a3d1 --- /dev/null +++ b/as/cmd/ADDA/adda1_ov1.casl @@ -0,0 +1,8 @@ +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/adda1_s0.casl b/as/cmd/ADDA/adda1_s0.casl new file mode 100644 index 0000000..054f189 --- /dev/null +++ b/as/cmd/ADDA/adda1_s0.casl @@ -0,0 +1,8 @@ +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/adda1_s1.casl b/as/cmd/ADDA/adda1_s1.casl new file mode 100644 index 0000000..9f28bc1 --- /dev/null +++ b/as/cmd/ADDA/adda1_s1.casl @@ -0,0 +1,8 @@ +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC -10 +B DC 20 + END diff --git a/as/cmd/ADDL/addl.casl b/as/cmd/ADDL/addl.casl new file mode 100644 index 0000000..6c69581 --- /dev/null +++ b/as/cmd/ADDL/addl.casl @@ -0,0 +1,8 @@ +MAIN START +BEGIN LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC 3 +B DC 1 + END diff --git a/as/cmd/ADDL/addl0.casl b/as/cmd/ADDL/addl0.casl new file mode 100644 index 0000000..5e2924c --- /dev/null +++ b/as/cmd/ADDL/addl0.casl @@ -0,0 +1,7 @@ +MAIN START +BEGIN LAD GR1,A + ADDL GR1,B + RET +A DC 3 +B DC 1 + END diff --git a/as/cmd/ADDL/addl0_ov0.casl b/as/cmd/ADDL/addl0_ov0.casl new file mode 100644 index 0000000..2c48a47 --- /dev/null +++ b/as/cmd/ADDL/addl0_ov0.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDL GR1,B + RET +A DC 32767 +B DC 10 + END diff --git a/as/cmd/ADDL/addl0_ov1.casl b/as/cmd/ADDL/addl0_ov1.casl new file mode 100644 index 0000000..4ef996f --- /dev/null +++ b/as/cmd/ADDL/addl0_ov1.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDL GR1,B + RET +A DC #8001 ; -32767 +B DC #FFF6 ; -10 + END diff --git a/as/cmd/ADDL/addl0_s0.casl b/as/cmd/ADDL/addl0_s0.casl new file mode 100644 index 0000000..215236d --- /dev/null +++ b/as/cmd/ADDL/addl0_s0.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + ADDL GR1,B + RET +A DC 10 +B DC #FFEC ; 65516 + END diff --git a/as/cmd/ADDL/addl1_ov0.casl b/as/cmd/ADDL/addl1_ov0.casl new file mode 100644 index 0000000..1a38af5 --- /dev/null +++ b/as/cmd/ADDL/addl1_ov0.casl @@ -0,0 +1,8 @@ +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC 32767 +B DC 10 + END diff --git a/as/cmd/ADDL/addl1_ov1.casl b/as/cmd/ADDL/addl1_ov1.casl new file mode 100644 index 0000000..326a3d1 --- /dev/null +++ b/as/cmd/ADDL/addl1_ov1.casl @@ -0,0 +1,8 @@ +MAIN START + LD GR1,A + LD GR2,B + ADDA GR1,GR2 + RET +A DC -32767 +B DC -10 + END diff --git a/as/cmd/ADDL/addl1_s0.casl b/as/cmd/ADDL/addl1_s0.casl new file mode 100644 index 0000000..34da997 --- /dev/null +++ b/as/cmd/ADDL/addl1_s0.casl @@ -0,0 +1,8 @@ +MAIN START + LD GR1,A + LD GR2,B + ADDL GR1,GR2 + RET +A DC 10 +B DC #FFEC ; 65516 + END diff --git a/as/cmd/AND/and0.casl b/as/cmd/AND/and0.casl new file mode 100644 index 0000000..c6169ec --- /dev/null +++ b/as/cmd/AND/and0.casl @@ -0,0 +1,7 @@ +MAIN START + LD GR1,A + AND GR1,B + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/cmd/AND/and1.casl b/as/cmd/AND/and1.casl new file mode 100644 index 0000000..d41a1d8 --- /dev/null +++ b/as/cmd/AND/and1.casl @@ -0,0 +1,8 @@ +MAIN START + LD GR1,A + LD GR2,B + AND GR1,GR2 + RET +A DC #3000 +B DC #4FFF + END diff --git a/as/CMD/call0.casl b/as/cmd/CALL/call0.casl similarity index 100% rename from as/CMD/call0.casl rename to as/cmd/CALL/call0.casl diff --git a/as/CMD/call1.casl b/as/cmd/CALL/call1.casl similarity index 100% rename from as/CMD/call1.casl rename to as/cmd/CALL/call1.casl diff --git a/as/CMD/call2.casl b/as/cmd/CALL/call2.casl similarity index 100% rename from as/CMD/call2.casl rename to as/cmd/CALL/call2.casl diff --git a/as/CMD/cpa1.casl b/as/cmd/CPA/cpa1.casl similarity index 100% rename from as/CMD/cpa1.casl rename to as/cmd/CPA/cpa1.casl diff --git a/as/CMD/cpl1.casl b/as/cmd/CPL/cpl1.casl similarity index 100% rename from as/CMD/cpl1.casl rename to as/cmd/CPL/cpl1.casl diff --git a/as/CMD/cpl2.casl b/as/cmd/CPL/cpl2.casl similarity index 100% rename from as/CMD/cpl2.casl rename to as/cmd/CPL/cpl2.casl diff --git a/as/CMD/cpl3.casl b/as/cmd/CPL/cpl3.casl similarity index 100% rename from as/CMD/cpl3.casl rename to as/cmd/CPL/cpl3.casl diff --git a/as/CMD/dc_overflow.casl b/as/cmd/DC/dc_overflow.casl similarity index 100% rename from as/CMD/dc_overflow.casl rename to as/cmd/DC/dc_overflow.casl diff --git a/as/CMD/dc_spc.casl b/as/cmd/DC/dc_spc.casl similarity index 100% rename from as/CMD/dc_spc.casl rename to as/cmd/DC/dc_spc.casl diff --git a/as/CMD/ds_0.casl b/as/cmd/DS/ds_0.casl similarity index 100% rename from as/CMD/ds_0.casl rename to as/cmd/DS/ds_0.casl diff --git a/as/CMD/lad0.casl b/as/cmd/LAD/lad0.casl similarity index 100% rename from as/CMD/lad0.casl rename to as/cmd/LAD/lad0.casl diff --git a/as/CMD/lad1.casl b/as/cmd/LAD/lad1.casl similarity index 100% rename from as/CMD/lad1.casl rename to as/cmd/LAD/lad1.casl diff --git a/as/CMD/lad2.casl b/as/cmd/LAD/lad2.casl similarity index 100% rename from as/CMD/lad2.casl rename to as/cmd/LAD/lad2.casl diff --git a/as/CMD/lad3.casl b/as/cmd/LAD/lad3.casl similarity index 100% rename from as/CMD/lad3.casl rename to as/cmd/LAD/lad3.casl diff --git a/as/CMD/lad4.casl b/as/cmd/LAD/lad4.casl similarity index 100% rename from as/CMD/lad4.casl rename to as/cmd/LAD/lad4.casl diff --git a/as/CMD/ld0.casl b/as/cmd/LD/ld0.casl similarity index 100% rename from as/CMD/ld0.casl rename to as/cmd/LD/ld0.casl diff --git a/as/CMD/ld1.casl b/as/cmd/LD/ld1.casl similarity index 100% rename from as/CMD/ld1.casl rename to as/cmd/LD/ld1.casl diff --git a/as/CMD/ld2.casl b/as/cmd/LD/ld2.casl similarity index 100% rename from as/CMD/ld2.casl rename to as/cmd/LD/ld2.casl diff --git a/as/CMD/ld3.casl b/as/cmd/LD/ld3.casl similarity index 100% rename from as/CMD/ld3.casl rename to as/cmd/LD/ld3.casl diff --git a/as/CMD/ld4.casl b/as/cmd/LD/ld4.casl similarity index 100% rename from as/CMD/ld4.casl rename to as/cmd/LD/ld4.casl diff --git a/as/CMD/ld5.casl b/as/cmd/LD/ld5.casl similarity index 100% rename from as/CMD/ld5.casl rename to as/cmd/LD/ld5.casl diff --git a/as/CMD/ld_loop.casl b/as/cmd/LD/ld_loop.casl similarity index 100% rename from as/CMD/ld_loop.casl rename to as/cmd/LD/ld_loop.casl diff --git a/as/CMD/nop.casl b/as/cmd/NOP/nop.casl similarity index 100% rename from as/CMD/nop.casl rename to as/cmd/NOP/nop.casl diff --git a/as/CMD/out0.casl b/as/cmd/OUT/out0.casl similarity index 100% rename from as/CMD/out0.casl rename to as/cmd/OUT/out0.casl diff --git a/as/CMD/out1.casl b/as/cmd/OUT/out1.casl similarity index 100% rename from as/CMD/out1.casl rename to as/cmd/OUT/out1.casl diff --git a/as/CMD/pushpop.casl b/as/cmd/PUSH/pushpop.casl similarity index 100% rename from as/CMD/pushpop.casl rename to as/cmd/PUSH/pushpop.casl diff --git a/as/CMD/sla2.casl b/as/cmd/SLA/sla2.casl similarity index 100% rename from as/CMD/sla2.casl rename to as/cmd/SLA/sla2.casl diff --git a/as/CMD/sla3.casl b/as/cmd/SLA/sla3.casl similarity index 100% rename from as/CMD/sla3.casl rename to as/cmd/SLA/sla3.casl diff --git a/as/CMD/sll2.casl b/as/cmd/SLA/sll2.casl similarity index 100% rename from as/CMD/sll2.casl rename to as/cmd/SLA/sll2.casl diff --git a/as/CMD/sll3.casl b/as/cmd/SLA/sll3.casl similarity index 100% rename from as/CMD/sll3.casl rename to as/cmd/SLA/sll3.casl diff --git a/as/CMD/sra2.casl b/as/cmd/SRA/sra2.casl similarity index 100% rename from as/CMD/sra2.casl rename to as/cmd/SRA/sra2.casl diff --git a/as/CMD/sra3.casl b/as/cmd/SRA/sra3.casl similarity index 100% rename from as/CMD/sra3.casl rename to as/cmd/SRA/sra3.casl diff --git a/as/CMD/sra4.casl b/as/cmd/SRA/sra4.casl similarity index 100% rename from as/CMD/sra4.casl rename to as/cmd/SRA/sra4.casl diff --git a/as/CMD/st0.casl b/as/cmd/ST/st0.casl similarity index 100% rename from as/CMD/st0.casl rename to as/cmd/ST/st0.casl diff --git a/as/CMD/st1.casl b/as/cmd/ST/st1.casl similarity index 100% rename from as/CMD/st1.casl rename to as/cmd/ST/st1.casl diff --git a/as/CMD/svc2.casl b/as/cmd/SVC/svc2.casl similarity index 100% rename from as/CMD/svc2.casl rename to as/cmd/SVC/svc2.casl diff --git a/as/cmd/XOR/literal_spc.casl b/as/cmd/XOR/literal_spc.casl new file mode 100644 index 0000000..7c98d7b --- /dev/null +++ b/as/cmd/XOR/literal_spc.casl @@ -0,0 +1,9 @@ +; リテラルに「=' '」を指定 +MAIN START + LD GR1,=' ' + ST GR1,BUF + OUT BUF,LEN + RET +BUF DS 1 +LEN DC 1 + END diff --git a/as/CMD/xor0.casl b/as/cmd/XOR/xor0.casl similarity index 100% rename from as/CMD/xor0.casl rename to as/cmd/XOR/xor0.casl diff --git a/as/CMD/xor1.casl b/as/cmd/XOR/xor1.casl similarity index 100% rename from as/CMD/xor1.casl rename to as/cmd/XOR/xor1.casl diff --git a/as/CMD/xor3.casl b/as/cmd/XOR/xor3.casl similarity index 100% rename from as/CMD/xor3.casl rename to as/cmd/XOR/xor3.casl diff --git a/as/CMD/xor4.casl b/as/cmd/XOR/xor4.casl similarity index 100% rename from as/CMD/xor4.casl rename to as/cmd/XOR/xor4.casl diff --git a/as/CMD/xor5.casl b/as/cmd/XOR/xor5.casl similarity index 100% rename from as/CMD/xor5.casl rename to as/cmd/XOR/xor5.casl diff --git a/as/CMD/literalstr.casl b/as/cmd/literalstr.casl similarity index 79% rename from as/CMD/literalstr.casl rename to as/cmd/literalstr.casl index 0fa3fd4..7a352de 100644 --- a/as/CMD/literalstr.casl +++ b/as/cmd/literalstr.casl @@ -2,12 +2,12 @@ MAIN START LAD GR1,='a' LAD GR2,10 LOOP CPA GR2,=0 - JZE LEND - JMI LEND + JZE FIN + JMI FIN LD GR3,0,GR1 ADDA GR1,=1 SUBA GR2,=1 JUMP LOOP -LEND RET +FIN RET LEN DC 5 END diff --git a/as/ERR/cmd_err0.casl b/as/err/cmd_err0.casl similarity index 100% rename from as/ERR/cmd_err0.casl rename to as/err/cmd_err0.casl diff --git a/as/ERR/cmd_err1.casl b/as/err/cmd_err1.casl similarity index 100% rename from as/ERR/cmd_err1.casl rename to as/err/cmd_err1.casl diff --git a/as/ERR/ds_err.casl b/as/err/ds_err.casl similarity index 100% rename from as/ERR/ds_err.casl rename to as/err/ds_err.casl diff --git a/as/ERR/labeldup_err.casl b/as/err/labeldup_err.casl similarity index 100% rename from as/ERR/labeldup_err.casl rename to as/err/labeldup_err.casl diff --git a/as/ERR/literalstr_err.casl b/as/err/literalstr_err.casl similarity index 100% rename from as/ERR/literalstr_err.casl rename to as/err/literalstr_err.casl diff --git a/as/ERR/opdspc_err.casl b/as/err/opdspc_err.casl similarity index 100% rename from as/ERR/opdspc_err.casl rename to as/err/opdspc_err.casl diff --git a/as/ERR/quoteend_err.casl b/as/err/quoteend_err.casl similarity index 100% rename from as/ERR/quoteend_err.casl rename to as/err/quoteend_err.casl diff --git a/as/FE_TESTS/2008_04/Q09/token.casl b/as/fe_tests/2008_04/Q09/token.casl similarity index 100% rename from as/FE_TESTS/2008_04/Q09/token.casl rename to as/fe_tests/2008_04/Q09/token.casl diff --git a/as/FE_TESTS/2008_04/Q09/token_call.casl b/as/fe_tests/2008_04/Q09/token_call.casl similarity index 100% rename from as/FE_TESTS/2008_04/Q09/token_call.casl rename to as/fe_tests/2008_04/Q09/token_call.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn1.casl b/as/fe_tests/2008_10/Q09/ptn1.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn1.casl rename to as/fe_tests/2008_10/Q09/ptn1.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn1_call.casl b/as/fe_tests/2008_10/Q09/ptn1_call.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn1_call.casl rename to as/fe_tests/2008_10/Q09/ptn1_call.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn2.casl b/as/fe_tests/2008_10/Q09/ptn2.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn2.casl rename to as/fe_tests/2008_10/Q09/ptn2.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn2_call.casl b/as/fe_tests/2008_10/Q09/ptn2_call.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn2_call.casl rename to as/fe_tests/2008_10/Q09/ptn2_call.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn3.casl b/as/fe_tests/2008_10/Q09/ptn3.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn3.casl rename to as/fe_tests/2008_10/Q09/ptn3.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn3_call.casl b/as/fe_tests/2008_10/Q09/ptn3_call.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn3_call.casl rename to as/fe_tests/2008_10/Q09/ptn3_call.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn4.casl b/as/fe_tests/2008_10/Q09/ptn4.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn4.casl rename to as/fe_tests/2008_10/Q09/ptn4.casl diff --git a/as/FE_TESTS/2008_10/Q09/ptn4_call.casl b/as/fe_tests/2008_10/Q09/ptn4_call.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q09/ptn4_call.casl rename to as/fe_tests/2008_10/Q09/ptn4_call.casl diff --git a/as/FE_TESTS/2008_10/Q13/summary.casl b/as/fe_tests/2008_10/Q13/summary.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q13/summary.casl rename to as/fe_tests/2008_10/Q13/summary.casl diff --git a/as/FE_TESTS/2008_10/Q13/summary_call.casl b/as/fe_tests/2008_10/Q13/summary_call.casl similarity index 100% rename from as/FE_TESTS/2008_10/Q13/summary_call.casl rename to as/fe_tests/2008_10/Q13/summary_call.casl diff --git a/as/FE_TESTS/2009_04/Q12/muls.casl b/as/fe_tests/2009_04/Q12/muls.casl similarity index 100% rename from as/FE_TESTS/2009_04/Q12/muls.casl rename to as/fe_tests/2009_04/Q12/muls.casl diff --git a/as/FE_TESTS/2009_04/Q12/muls2.casl b/as/fe_tests/2009_04/Q12/muls2.casl similarity index 100% rename from as/FE_TESTS/2009_04/Q12/muls2.casl rename to as/fe_tests/2009_04/Q12/muls2.casl diff --git a/as/FE_TESTS/2009_04/Q12/muls2_call.casl b/as/fe_tests/2009_04/Q12/muls2_call.casl similarity index 100% rename from as/FE_TESTS/2009_04/Q12/muls2_call.casl rename to as/fe_tests/2009_04/Q12/muls2_call.casl diff --git a/as/FE_TESTS/2009_04/Q12/muls_call.casl b/as/fe_tests/2009_04/Q12/muls_call.casl similarity index 100% rename from as/FE_TESTS/2009_04/Q12/muls_call.casl rename to as/fe_tests/2009_04/Q12/muls_call.casl diff --git a/as/FE_TESTS/2009_10/Q12/outb.casl b/as/fe_tests/2009_10/Q12/outb.casl similarity index 100% rename from as/FE_TESTS/2009_10/Q12/outb.casl rename to as/fe_tests/2009_10/Q12/outb.casl diff --git a/as/FE_TESTS/2009_10/Q12/replace.casl b/as/fe_tests/2009_10/Q12/replace.casl similarity index 100% rename from as/FE_TESTS/2009_10/Q12/replace.casl rename to as/fe_tests/2009_10/Q12/replace.casl diff --git a/as/FE_TESTS/2009_10/Q12/replace_call.casl b/as/fe_tests/2009_10/Q12/replace_call.casl similarity index 100% rename from as/FE_TESTS/2009_10/Q12/replace_call.casl rename to as/fe_tests/2009_10/Q12/replace_call.casl diff --git a/as/hello.casl b/as/hello.casl index 191f75a..e02055c 100644 --- a/as/hello.casl +++ b/as/hello.casl @@ -1,6 +1,6 @@ -MAIN START - OUT BUF,LEN - RET -BUF DC 'Hello, World!' -LEN DC 13 - END +MAIN START + OUT OBUF,LEN + RET +OBUF DC 'Hello, World!' +LEN DC 13 + END diff --git a/as/macro/in/in.casl b/as/macro/in/in.casl new file mode 100644 index 0000000..de3509d --- /dev/null +++ b/as/macro/in/in.casl @@ -0,0 +1,8 @@ +;;; CASL IIマクロ命令「IN IBUF LEN」で生成される命令群 + PUSH 0,GR1 + PUSH 0,GR2 + LAD GR1,IBUF + LAD GR2,LEN + SVC 1 + POP GR2 + POP GR1 diff --git a/as/macro/in/intest0.casl b/as/macro/in/intest0.casl new file mode 100644 index 0000000..43a89e0 --- /dev/null +++ b/as/macro/in/intest0.casl @@ -0,0 +1,7 @@ +MAIN START + IN IBUF,LEN + OUT IBUF,LEN + RET +IBUF DS 100 +LEN DC 1 + END diff --git a/as/macro/in/intest1.casl b/as/macro/in/intest1.casl new file mode 100644 index 0000000..2877bc8 --- /dev/null +++ b/as/macro/in/intest1.casl @@ -0,0 +1,14 @@ +MAIN START + PUSH 0,GR1 + PUSH 0,GR2 + LAD GR1,IBUF + LAD GR2,LEN + SVC 1 + POP GR2 + POP GR1 + IN IBUF,LEN + OUT IBUF,LEN + RET +IBUF DS 100 +LEN DC 1 + END diff --git a/as/macro/in/str.txt b/as/macro/in/str.txt new file mode 100644 index 0000000..6097ccb --- /dev/null +++ b/as/macro/in/str.txt @@ -0,0 +1 @@ +1234567890abcdefghijkLMNOPQRST diff --git a/as/macro/out/hello0.casl b/as/macro/out/hello0.casl new file mode 100644 index 0000000..e02055c --- /dev/null +++ b/as/macro/out/hello0.casl @@ -0,0 +1,6 @@ +MAIN START + OUT OBUF,LEN + RET +OBUF DC 'Hello, World!' +LEN DC 13 + END diff --git a/as/CMD/svc2_out.casl b/as/macro/out/hello1.casl similarity index 71% rename from as/CMD/svc2_out.casl rename to as/macro/out/hello1.casl index aff4b29..a697251 100644 --- a/as/CMD/svc2_out.casl +++ b/as/macro/out/hello1.casl @@ -1,5 +1,4 @@ -;;; 「OUT」と同等のプログラム -OTEST START +MAIN START PUSH 0,GR1 PUSH 0,GR2 LAD GR1,OBUF @@ -11,6 +10,6 @@ OTEST START POP GR2 POP GR1 RET -OBUF DC 'abcd' -LEN DC 4 +OBUF DC 'Hello, World!' +LEN DC 13 END diff --git a/as/macro/out/out.casl b/as/macro/out/out.casl new file mode 100644 index 0000000..6bdf9cd --- /dev/null +++ b/as/macro/out/out.casl @@ -0,0 +1,11 @@ +;;; CASL IIマクロ命令「OUT OBUF LEN」で生成される命令群 + PUSH 0,GR1 + PUSH 0,GR2 + LAD GR1,OBUF + LAD GR2,LEN + SVC 2 + LAD GR1,=#A + LAD GR2,=1 + SVC 2 + POP GR2 + POP GR1 diff --git a/as/FUNC/cnt60.casl b/as/misc/cnt60.casl similarity index 100% rename from as/FUNC/cnt60.casl rename to as/misc/cnt60.casl diff --git a/as/misc/count1.casl b/as/misc/count1.casl new file mode 100644 index 0000000..52e6b03 --- /dev/null +++ b/as/misc/count1.casl @@ -0,0 +1,19 @@ +;;; 「アセンブラ言語の使用」に掲載されているサンプル +COUNT1 START +; 入力 GR1:検索する語 +; 処理 GR1中の'1'のビットの個数を求める +; 出力 GR0:GR1中の'1'のビットの個数 + PUSH 0,GR1 ; + PUSH 0,GR2 ; + SUBA GR2,GR2 ; Count = 0 + AND GR1,GR1 ; 全部のビットが'0'? + JZE RETURN ; 全部のビットが'0'なら終了 +MORE LAD GR2,1,GR2 ; Count = Count + 1 + LAD GR0,-1,GR1 ; 最下位の'1'のビット1個を + AND GR1,GR0 ; '0'に変える + JNZ MORE ; '1'のビットが残っていれば繰返し +RETURN LD GR0,GR2 ; GR0 = Count + POP GR2 ; + POP GR1 ; + RET ; 呼び出しプログラムへ戻る + END ; diff --git a/as/FUNC/divl0.casl b/as/misc/divl0.casl similarity index 100% rename from as/FUNC/divl0.casl rename to as/misc/divl0.casl diff --git a/as/FUNC/fib.casl b/as/misc/fib.casl similarity index 100% rename from as/FUNC/fib.casl rename to as/misc/fib.casl diff --git a/as/FUNC/fib_outl.casl b/as/misc/fib_outl.casl similarity index 100% rename from as/FUNC/fib_outl.casl rename to as/misc/fib_outl.casl diff --git a/as/FUNC/hanoi.casl b/as/misc/hanoi.casl similarity index 100% rename from as/FUNC/hanoi.casl rename to as/misc/hanoi.casl diff --git a/as/FUNC/iotest.casl b/as/misc/iotest.casl similarity index 50% rename from as/FUNC/iotest.casl rename to as/misc/iotest.casl index af25ff3..fe5f553 100644 --- a/as/FUNC/iotest.casl +++ b/as/misc/iotest.casl @@ -1,13 +1,13 @@ IOTEST START - OUT OBUF1,OLEN1 + OUT OBUF1,OLEN1 LOOP IN IOBUF,IOLEN - LD GR1,IOLEN - JZE RETURN - OUT OBUF2,OLEN2 - OUT IOBUF,IOLEN - OUT OBUF3,OLEN3 - JUMP LOOP -RETURN RET + LD GR1,IOLEN + JZE RETURN + OUT OBUF2,OLEN2 + OUT IOBUF,IOLEN + OUT OBUF3,OLEN3 + JUMP LOOP +RETURN RET ; Memory OBUF1 DC 'LET''S START. TYPE IN' OLEN1 DC 20 @@ -16,5 +16,5 @@ OLEN2 DC 9 OBUF3 DC 'WHAT''S NEXT?' OLEN3 DC 12 IOBUF DS 64 -IOLEN DS 1 - END +IOLEN DS 1 + END diff --git a/as/FUNC/mula0.casl b/as/misc/mula0.casl similarity index 100% rename from as/FUNC/mula0.casl rename to as/misc/mula0.casl diff --git a/as/FUNC/mula_timestab.casl b/as/misc/mula_timestab.casl similarity index 100% rename from as/FUNC/mula_timestab.casl rename to as/misc/mula_timestab.casl diff --git a/as/FUNC/mull0.casl b/as/misc/mull0.casl similarity index 100% rename from as/FUNC/mull0.casl rename to as/misc/mull0.casl diff --git a/as/FUNC/mull_timestab.casl b/as/misc/mull_timestab.casl similarity index 100% rename from as/FUNC/mull_timestab.casl rename to as/misc/mull_timestab.casl diff --git a/as/FUNC/sum_10.casl b/as/misc/sum_10.casl similarity index 100% rename from as/FUNC/sum_10.casl rename to as/misc/sum_10.casl diff --git a/as/FUNC/sum_10_2.casl b/as/misc/sum_10_2.casl similarity index 100% rename from as/FUNC/sum_10_2.casl rename to as/misc/sum_10_2.casl diff --git a/as/YAKUWA/README.txt b/as/yakuwa/README.txt similarity index 100% rename from as/YAKUWA/README.txt rename to as/yakuwa/README.txt diff --git a/as/YAKUWA/binout.casl b/as/yakuwa/binout.casl similarity index 100% rename from as/YAKUWA/binout.casl rename to as/yakuwa/binout.casl diff --git a/as/YAKUWA/floatedit.casl b/as/yakuwa/floatedit.casl similarity index 100% rename from as/YAKUWA/floatedit.casl rename to as/yakuwa/floatedit.casl diff --git a/test/integration/casl2/adda0/0.txt b/test/integration/casl2/cmd_adda0/0.txt similarity index 100% rename from test/integration/casl2/adda0/0.txt rename to test/integration/casl2/cmd_adda0/0.txt diff --git a/test/integration/casl2/adda0/Makefile b/test/integration/casl2/cmd_adda0/Makefile similarity index 100% rename from test/integration/casl2/adda0/Makefile rename to test/integration/casl2/cmd_adda0/Makefile diff --git a/test/integration/casl2/adda1/0.txt b/test/integration/casl2/cmd_adda1/0.txt similarity index 100% rename from test/integration/casl2/adda1/0.txt rename to test/integration/casl2/cmd_adda1/0.txt diff --git a/test/integration/casl2/adda1/Makefile b/test/integration/casl2/cmd_adda1/Makefile similarity index 100% rename from test/integration/casl2/adda1/Makefile rename to test/integration/casl2/cmd_adda1/Makefile diff --git a/test/integration/casl2/adda_overflow/0.txt b/test/integration/casl2/cmd_adda_overflow/0.txt similarity index 100% rename from test/integration/casl2/adda_overflow/0.txt rename to test/integration/casl2/cmd_adda_overflow/0.txt diff --git a/test/integration/casl2/adda_overflow/Makefile b/test/integration/casl2/cmd_adda_overflow/Makefile similarity index 100% rename from test/integration/casl2/adda_overflow/Makefile rename to test/integration/casl2/cmd_adda_overflow/Makefile diff --git a/test/integration/casl2/addl/0.txt b/test/integration/casl2/cmd_addl/0.txt similarity index 100% rename from test/integration/casl2/addl/0.txt rename to test/integration/casl2/cmd_addl/0.txt diff --git a/test/integration/casl2/addl/Makefile b/test/integration/casl2/cmd_addl/Makefile similarity index 100% rename from test/integration/casl2/addl/Makefile rename to test/integration/casl2/cmd_addl/Makefile diff --git a/test/integration/casl2/addl_overflow/0.txt b/test/integration/casl2/cmd_addl_overflow/0.txt similarity index 100% rename from test/integration/casl2/addl_overflow/0.txt rename to test/integration/casl2/cmd_addl_overflow/0.txt diff --git a/test/integration/casl2/addl_overflow/Makefile b/test/integration/casl2/cmd_addl_overflow/Makefile similarity index 100% rename from test/integration/casl2/addl_overflow/Makefile rename to test/integration/casl2/cmd_addl_overflow/Makefile diff --git a/test/integration/casl2/and0/0.txt b/test/integration/casl2/cmd_and0/0.txt similarity index 100% rename from test/integration/casl2/and0/0.txt rename to test/integration/casl2/cmd_and0/0.txt diff --git a/test/integration/casl2/and0/Makefile b/test/integration/casl2/cmd_and0/Makefile similarity index 100% rename from test/integration/casl2/and0/Makefile rename to test/integration/casl2/cmd_and0/Makefile diff --git a/test/integration/casl2/and1/0.txt b/test/integration/casl2/cmd_and1/0.txt similarity index 100% rename from test/integration/casl2/and1/0.txt rename to test/integration/casl2/cmd_and1/0.txt diff --git a/test/integration/casl2/and1/Makefile b/test/integration/casl2/cmd_and1/Makefile similarity index 100% rename from test/integration/casl2/and1/Makefile rename to test/integration/casl2/cmd_and1/Makefile diff --git a/test/integration/casl2/and2/0.txt b/test/integration/casl2/cmd_and2/0.txt similarity index 100% rename from test/integration/casl2/and2/0.txt rename to test/integration/casl2/cmd_and2/0.txt diff --git a/test/integration/casl2/and2/Makefile b/test/integration/casl2/cmd_and2/Makefile similarity index 100% rename from test/integration/casl2/and2/Makefile rename to test/integration/casl2/cmd_and2/Makefile diff --git a/test/integration/casl2/and3/0.txt b/test/integration/casl2/cmd_and3/0.txt similarity index 100% rename from test/integration/casl2/and3/0.txt rename to test/integration/casl2/cmd_and3/0.txt diff --git a/test/integration/casl2/and3/Makefile b/test/integration/casl2/cmd_and3/Makefile similarity index 100% rename from test/integration/casl2/and3/Makefile rename to test/integration/casl2/cmd_and3/Makefile diff --git a/test/integration/casl2/call0/0.txt b/test/integration/casl2/cmd_call0/0.txt similarity index 100% rename from test/integration/casl2/call0/0.txt rename to test/integration/casl2/cmd_call0/0.txt diff --git a/test/integration/casl2/call0/Makefile b/test/integration/casl2/cmd_call0/Makefile similarity index 100% rename from test/integration/casl2/call0/Makefile rename to test/integration/casl2/cmd_call0/Makefile diff --git a/test/integration/casl2/call1/0.txt b/test/integration/casl2/cmd_call1/0.txt similarity index 100% rename from test/integration/casl2/call1/0.txt rename to test/integration/casl2/cmd_call1/0.txt diff --git a/test/integration/casl2/call1/Makefile b/test/integration/casl2/cmd_call1/Makefile similarity index 100% rename from test/integration/casl2/call1/Makefile rename to test/integration/casl2/cmd_call1/Makefile diff --git a/test/integration/casl2/call2/0.txt b/test/integration/casl2/cmd_call2/0.txt similarity index 100% rename from test/integration/casl2/call2/0.txt rename to test/integration/casl2/cmd_call2/0.txt diff --git a/test/integration/casl2/call2/Makefile b/test/integration/casl2/cmd_call2/Makefile similarity index 100% rename from test/integration/casl2/call2/Makefile rename to test/integration/casl2/cmd_call2/Makefile diff --git a/test/integration/casl2/cpa1/0.txt b/test/integration/casl2/cmd_cpa1/0.txt similarity index 100% rename from test/integration/casl2/cpa1/0.txt rename to test/integration/casl2/cmd_cpa1/0.txt diff --git a/test/integration/casl2/cpa1/Makefile b/test/integration/casl2/cmd_cpa1/Makefile similarity index 100% rename from test/integration/casl2/cpa1/Makefile rename to test/integration/casl2/cmd_cpa1/Makefile diff --git a/test/integration/casl2/dc_overflow/0.txt b/test/integration/casl2/cmd_dc_overflow/0.txt similarity index 100% rename from test/integration/casl2/dc_overflow/0.txt rename to test/integration/casl2/cmd_dc_overflow/0.txt diff --git a/test/integration/casl2/dc_overflow/Makefile b/test/integration/casl2/cmd_dc_overflow/Makefile similarity index 100% rename from test/integration/casl2/dc_overflow/Makefile rename to test/integration/casl2/cmd_dc_overflow/Makefile diff --git a/test/integration/casl2/dc_spc/0.txt b/test/integration/casl2/cmd_dc_spc/0.txt similarity index 100% rename from test/integration/casl2/dc_spc/0.txt rename to test/integration/casl2/cmd_dc_spc/0.txt diff --git a/test/integration/casl2/dc_spc/Makefile b/test/integration/casl2/cmd_dc_spc/Makefile similarity index 100% rename from test/integration/casl2/dc_spc/Makefile rename to test/integration/casl2/cmd_dc_spc/Makefile diff --git a/test/integration/casl2/ds_0/0.txt b/test/integration/casl2/cmd_ds_0/0.txt similarity index 100% rename from test/integration/casl2/ds_0/0.txt rename to test/integration/casl2/cmd_ds_0/0.txt diff --git a/test/integration/casl2/ds_0/Makefile b/test/integration/casl2/cmd_ds_0/Makefile similarity index 100% rename from test/integration/casl2/ds_0/Makefile rename to test/integration/casl2/cmd_ds_0/Makefile diff --git a/test/integration/casl2/lad0/0.txt b/test/integration/casl2/cmd_lad0/0.txt similarity index 100% rename from test/integration/casl2/lad0/0.txt rename to test/integration/casl2/cmd_lad0/0.txt diff --git a/test/integration/casl2/lad0/Makefile b/test/integration/casl2/cmd_lad0/Makefile similarity index 100% rename from test/integration/casl2/lad0/Makefile rename to test/integration/casl2/cmd_lad0/Makefile diff --git a/test/integration/casl2/lad1/0.txt b/test/integration/casl2/cmd_lad1/0.txt similarity index 100% rename from test/integration/casl2/lad1/0.txt rename to test/integration/casl2/cmd_lad1/0.txt diff --git a/test/integration/casl2/lad1/Makefile b/test/integration/casl2/cmd_lad1/Makefile similarity index 100% rename from test/integration/casl2/lad1/Makefile rename to test/integration/casl2/cmd_lad1/Makefile diff --git a/test/integration/casl2/lad2/0.txt b/test/integration/casl2/cmd_lad2/0.txt similarity index 100% rename from test/integration/casl2/lad2/0.txt rename to test/integration/casl2/cmd_lad2/0.txt diff --git a/test/integration/casl2/lad2/Makefile b/test/integration/casl2/cmd_lad2/Makefile similarity index 100% rename from test/integration/casl2/lad2/Makefile rename to test/integration/casl2/cmd_lad2/Makefile diff --git a/test/integration/casl2/lad3/0.txt b/test/integration/casl2/cmd_lad3/0.txt similarity index 100% rename from test/integration/casl2/lad3/0.txt rename to test/integration/casl2/cmd_lad3/0.txt diff --git a/test/integration/casl2/lad3/Makefile b/test/integration/casl2/cmd_lad3/Makefile similarity index 100% rename from test/integration/casl2/lad3/Makefile rename to test/integration/casl2/cmd_lad3/Makefile diff --git a/test/integration/casl2/ld0/0.txt b/test/integration/casl2/cmd_ld0/0.txt similarity index 100% rename from test/integration/casl2/ld0/0.txt rename to test/integration/casl2/cmd_ld0/0.txt diff --git a/test/integration/casl2/ld0/Makefile b/test/integration/casl2/cmd_ld0/Makefile similarity index 100% rename from test/integration/casl2/ld0/Makefile rename to test/integration/casl2/cmd_ld0/Makefile diff --git a/test/integration/casl2/ld1/0.txt b/test/integration/casl2/cmd_ld1/0.txt similarity index 100% rename from test/integration/casl2/ld1/0.txt rename to test/integration/casl2/cmd_ld1/0.txt diff --git a/test/integration/casl2/ld1/Makefile b/test/integration/casl2/cmd_ld1/Makefile similarity index 100% rename from test/integration/casl2/ld1/Makefile rename to test/integration/casl2/cmd_ld1/Makefile diff --git a/test/integration/casl2/ld2/0.txt b/test/integration/casl2/cmd_ld2/0.txt similarity index 100% rename from test/integration/casl2/ld2/0.txt rename to test/integration/casl2/cmd_ld2/0.txt diff --git a/test/integration/casl2/ld2/Makefile b/test/integration/casl2/cmd_ld2/Makefile similarity index 100% rename from test/integration/casl2/ld2/Makefile rename to test/integration/casl2/cmd_ld2/Makefile diff --git a/test/integration/casl2/ld3/0.txt b/test/integration/casl2/cmd_ld3/0.txt similarity index 100% rename from test/integration/casl2/ld3/0.txt rename to test/integration/casl2/cmd_ld3/0.txt diff --git a/test/integration/casl2/ld3/Makefile b/test/integration/casl2/cmd_ld3/Makefile similarity index 100% rename from test/integration/casl2/ld3/Makefile rename to test/integration/casl2/cmd_ld3/Makefile diff --git a/test/integration/casl2/ld4/0.txt b/test/integration/casl2/cmd_ld4/0.txt similarity index 100% rename from test/integration/casl2/ld4/0.txt rename to test/integration/casl2/cmd_ld4/0.txt diff --git a/test/integration/casl2/ld4/Makefile b/test/integration/casl2/cmd_ld4/Makefile similarity index 100% rename from test/integration/casl2/ld4/Makefile rename to test/integration/casl2/cmd_ld4/Makefile diff --git a/test/integration/casl2/ld5/0.txt b/test/integration/casl2/cmd_ld5/0.txt similarity index 100% rename from test/integration/casl2/ld5/0.txt rename to test/integration/casl2/cmd_ld5/0.txt diff --git a/test/integration/casl2/ld5/Makefile b/test/integration/casl2/cmd_ld5/Makefile similarity index 100% rename from test/integration/casl2/ld5/Makefile rename to test/integration/casl2/cmd_ld5/Makefile diff --git a/test/integration/casl2/ld_loop/0.txt b/test/integration/casl2/cmd_ld_loop/0.txt similarity index 100% rename from test/integration/casl2/ld_loop/0.txt rename to test/integration/casl2/cmd_ld_loop/0.txt diff --git a/test/integration/casl2/ld_loop/Makefile b/test/integration/casl2/cmd_ld_loop/Makefile similarity index 100% rename from test/integration/casl2/ld_loop/Makefile rename to test/integration/casl2/cmd_ld_loop/Makefile diff --git a/test/integration/casl2/literal_spc/0.txt b/test/integration/casl2/cmd_literal_spc/0.txt similarity index 100% rename from test/integration/casl2/literal_spc/0.txt rename to test/integration/casl2/cmd_literal_spc/0.txt diff --git a/test/integration/casl2/literal_spc/Makefile b/test/integration/casl2/cmd_literal_spc/Makefile similarity index 100% rename from test/integration/casl2/literal_spc/Makefile rename to test/integration/casl2/cmd_literal_spc/Makefile diff --git a/test/integration/casl2/literalstr/0.txt b/test/integration/casl2/cmd_literalstr/0.txt similarity index 100% rename from test/integration/casl2/literalstr/0.txt rename to test/integration/casl2/cmd_literalstr/0.txt diff --git a/test/integration/casl2/literalstr/Makefile b/test/integration/casl2/cmd_literalstr/Makefile similarity index 100% rename from test/integration/casl2/literalstr/Makefile rename to test/integration/casl2/cmd_literalstr/Makefile diff --git a/test/integration/casl2/out0/0.txt b/test/integration/casl2/cmd_out0/0.txt similarity index 100% rename from test/integration/casl2/out0/0.txt rename to test/integration/casl2/cmd_out0/0.txt diff --git a/test/integration/casl2/out0/Makefile b/test/integration/casl2/cmd_out0/Makefile similarity index 100% rename from test/integration/casl2/out0/Makefile rename to test/integration/casl2/cmd_out0/Makefile diff --git a/test/integration/casl2/out1/0.txt b/test/integration/casl2/cmd_out1/0.txt similarity index 100% rename from test/integration/casl2/out1/0.txt rename to test/integration/casl2/cmd_out1/0.txt diff --git a/test/integration/casl2/out1/Makefile b/test/integration/casl2/cmd_out1/Makefile similarity index 100% rename from test/integration/casl2/out1/Makefile rename to test/integration/casl2/cmd_out1/Makefile diff --git a/test/integration/casl2/pushpop/0.txt b/test/integration/casl2/cmd_pushpop/0.txt similarity index 100% rename from test/integration/casl2/pushpop/0.txt rename to test/integration/casl2/cmd_pushpop/0.txt diff --git a/test/integration/casl2/pushpop/Makefile b/test/integration/casl2/cmd_pushpop/Makefile similarity index 100% rename from test/integration/casl2/pushpop/Makefile rename to test/integration/casl2/cmd_pushpop/Makefile diff --git a/test/integration/casl2/sla2/0.txt b/test/integration/casl2/cmd_sla2/0.txt similarity index 100% rename from test/integration/casl2/sla2/0.txt rename to test/integration/casl2/cmd_sla2/0.txt diff --git a/test/integration/casl2/sla2/Makefile b/test/integration/casl2/cmd_sla2/Makefile similarity index 100% rename from test/integration/casl2/sla2/Makefile rename to test/integration/casl2/cmd_sla2/Makefile diff --git a/test/integration/casl2/sra2/0.txt b/test/integration/casl2/cmd_sra2/0.txt similarity index 100% rename from test/integration/casl2/sra2/0.txt rename to test/integration/casl2/cmd_sra2/0.txt diff --git a/test/integration/casl2/sra2/Makefile b/test/integration/casl2/cmd_sra2/Makefile similarity index 100% rename from test/integration/casl2/sra2/Makefile rename to test/integration/casl2/cmd_sra2/Makefile diff --git a/test/integration/casl2/sra3/0.txt b/test/integration/casl2/cmd_sra3/0.txt similarity index 100% rename from test/integration/casl2/sra3/0.txt rename to test/integration/casl2/cmd_sra3/0.txt diff --git a/test/integration/casl2/sra3/Makefile b/test/integration/casl2/cmd_sra3/Makefile similarity index 100% rename from test/integration/casl2/sra3/Makefile rename to test/integration/casl2/cmd_sra3/Makefile diff --git a/test/integration/casl2/sra4/0.txt b/test/integration/casl2/cmd_sra4/0.txt similarity index 100% rename from test/integration/casl2/sra4/0.txt rename to test/integration/casl2/cmd_sra4/0.txt diff --git a/test/integration/casl2/sra4/Makefile b/test/integration/casl2/cmd_sra4/Makefile similarity index 100% rename from test/integration/casl2/sra4/Makefile rename to test/integration/casl2/cmd_sra4/Makefile diff --git a/test/integration/casl2/st0/0.txt b/test/integration/casl2/cmd_st0/0.txt similarity index 100% rename from test/integration/casl2/st0/0.txt rename to test/integration/casl2/cmd_st0/0.txt diff --git a/test/integration/casl2/st0/Makefile b/test/integration/casl2/cmd_st0/Makefile similarity index 100% rename from test/integration/casl2/st0/Makefile rename to test/integration/casl2/cmd_st0/Makefile diff --git a/test/integration/casl2/st1/0.txt b/test/integration/casl2/cmd_st1/0.txt similarity index 100% rename from test/integration/casl2/st1/0.txt rename to test/integration/casl2/cmd_st1/0.txt diff --git a/test/integration/casl2/st1/Makefile b/test/integration/casl2/cmd_st1/Makefile similarity index 100% rename from test/integration/casl2/st1/Makefile rename to test/integration/casl2/cmd_st1/Makefile diff --git a/test/integration/casl2/svc2/0.txt b/test/integration/casl2/cmd_svc2/0.txt similarity index 100% rename from test/integration/casl2/svc2/0.txt rename to test/integration/casl2/cmd_svc2/0.txt diff --git a/test/integration/casl2/svc2/Makefile b/test/integration/casl2/cmd_svc2/Makefile similarity index 100% rename from test/integration/casl2/svc2/Makefile rename to test/integration/casl2/cmd_svc2/Makefile diff --git a/test/integration/casl2/xor0/0.txt b/test/integration/casl2/cmd_xor0/0.txt similarity index 100% rename from test/integration/casl2/xor0/0.txt rename to test/integration/casl2/cmd_xor0/0.txt diff --git a/test/integration/casl2/xor0/Makefile b/test/integration/casl2/cmd_xor0/Makefile similarity index 100% rename from test/integration/casl2/xor0/Makefile rename to test/integration/casl2/cmd_xor0/Makefile diff --git a/test/integration/casl2/xor1/0.txt b/test/integration/casl2/cmd_xor1/0.txt similarity index 100% rename from test/integration/casl2/xor1/0.txt rename to test/integration/casl2/cmd_xor1/0.txt diff --git a/test/integration/casl2/xor1/Makefile b/test/integration/casl2/cmd_xor1/Makefile similarity index 100% rename from test/integration/casl2/xor1/Makefile rename to test/integration/casl2/cmd_xor1/Makefile diff --git a/test/integration/casl2/xor3/0.txt b/test/integration/casl2/cmd_xor3/0.txt similarity index 100% rename from test/integration/casl2/xor3/0.txt rename to test/integration/casl2/cmd_xor3/0.txt diff --git a/test/integration/casl2/xor3/Makefile b/test/integration/casl2/cmd_xor3/Makefile similarity index 100% rename from test/integration/casl2/xor3/Makefile rename to test/integration/casl2/cmd_xor3/Makefile diff --git a/test/integration/casl2/xor4/0.txt b/test/integration/casl2/cmd_xor4/0.txt similarity index 100% rename from test/integration/casl2/xor4/0.txt rename to test/integration/casl2/cmd_xor4/0.txt diff --git a/test/integration/casl2/xor4/Makefile b/test/integration/casl2/cmd_xor4/Makefile similarity index 100% rename from test/integration/casl2/xor4/Makefile rename to test/integration/casl2/cmd_xor4/Makefile diff --git a/test/integration/casl2/xor5/0.txt b/test/integration/casl2/cmd_xor5/0.txt similarity index 100% rename from test/integration/casl2/xor5/0.txt rename to test/integration/casl2/cmd_xor5/0.txt diff --git a/test/integration/casl2/xor5/Makefile b/test/integration/casl2/cmd_xor5/Makefile similarity index 100% rename from test/integration/casl2/xor5/Makefile rename to test/integration/casl2/cmd_xor5/Makefile diff --git a/test/integration/casl2/hello/0.txt b/test/integration/casl2/hello/0.txt index 64af2dc..95e88bc 100644 --- a/test/integration/casl2/hello/0.txt +++ b/test/integration/casl2/hello/0.txt @@ -1,21 +1,21 @@ ../../../../casl2 -sla ../../../../as/hello.casl Assemble ../../../../as/hello.casl (0) -../../../../as/hello.casl: 1:MAIN START -../../../../as/hello.casl: 2: OUT BUF,LEN -../../../../as/hello.casl: 3: RET -../../../../as/hello.casl: 4:BUF DC 'Hello, World!' -../../../../as/hello.casl: 5:LEN DC 13 -../../../../as/hello.casl: 6: END +../../../../as/hello.casl: 1:MAIN START +../../../../as/hello.casl: 2: OUT OBUF,LEN +../../../../as/hello.casl: 3: RET +../../../../as/hello.casl: 4:OBUF DC 'Hello, World!' +../../../../as/hello.casl: 5:LEN DC 13 +../../../../as/hello.casl: 6: END Label:::: MAIN.LEN ---> #0020 MAIN ---> #0000 -MAIN.BUF ---> #0013 +MAIN.OBUF ---> #0013 Assemble ../../../../as/hello.casl (1) -../../../../as/hello.casl: 1:MAIN START -../../../../as/hello.casl: 2: OUT BUF,LEN +../../../../as/hello.casl: 1:MAIN START +../../../../as/hello.casl: 2: OUT OBUF,LEN #0000 #7001 #0001 #0000 #0002 #7002 @@ -36,9 +36,9 @@ Assemble ../../../../as/hello.casl (1) #000F #0002 #0010 #7120 #0011 #7110 -../../../../as/hello.casl: 3: RET +../../../../as/hello.casl: 3: RET #0012 #8100 -../../../../as/hello.casl: 4:BUF DC 'Hello, World!' +../../../../as/hello.casl: 4:OBUF DC 'Hello, World!' #0013 #0048 #0014 #0065 #0015 #006C @@ -52,7 +52,7 @@ Assemble ../../../../as/hello.casl (1) #001D #006C #001E #0064 #001F #0021 -../../../../as/hello.casl: 5:LEN DC 13 +../../../../as/hello.casl: 5:LEN DC 13 #0020 #000D -../../../../as/hello.casl: 6: END +../../../../as/hello.casl: 6: END Hello, World! diff --git a/test/integration/casl2/minim_call/Makefile b/test/integration/casl2/minim_call/Makefile index ba0159d..b0bf0c6 100644 --- a/test/integration/casl2/minim_call/Makefile +++ b/test/integration/casl2/minim_call/Makefile @@ -1,5 +1,6 @@ include ../CMD.mk # YACASL2DIR, CASL2 -ASDIR = $(YACASL2DIR)/as/FUNC -ASFILE = $(ASDIR)/minim_call.casl $(ASDIR)/minim.casl $(ASDIR)/outa.casl +ASDIR = $(YACASL2DIR)/as/casl2lib_test +LIBDIR = $(YACASL2DIR)/as/casl2lib +ASFILE = $(ASDIR)/minim_call.casl $(LIBDIR)/minim.casl $(LIBDIR)/outa.casl CMD = $(CASL2) $(ASFILE) include ../TEST.mk diff --git a/test/integration/casl2/svc2_out/0.txt b/test/integration/casl2/misc_out_hello/0.txt similarity index 94% rename from test/integration/casl2/svc2_out/0.txt rename to test/integration/casl2/misc_out_hello/0.txt index e42f94d..3957e4f 100644 --- a/test/integration/casl2/svc2_out/0.txt +++ b/test/integration/casl2/misc_out_hello/0.txt @@ -6,10 +6,10 @@ Assemble ../../../../as/CMD/svc2_out.casl (0) ../../../../as/CMD/svc2_out.casl: 3: PUSH 0,GR1 ../../../../as/CMD/svc2_out.casl: 4: PUSH 0,GR2 ../../../../as/CMD/svc2_out.casl: 5: LAD GR1,OBUF -../../../../as/CMD/svc2_out.casl: 6: LAD GR2,LEN +../../../../as/CMD/svc2_out.casl: 6: LD GR2,LEN ../../../../as/CMD/svc2_out.casl: 7: SVC 2 ../../../../as/CMD/svc2_out.casl: 8: LAD GR1,=#A -../../../../as/CMD/svc2_out.casl: 9: LAD GR2,=1 +../../../../as/CMD/svc2_out.casl: 9: LAD GR2,1 ../../../../as/CMD/svc2_out.casl: 10: SVC 2 ../../../../as/CMD/svc2_out.casl: 11: POP GR2 ../../../../as/CMD/svc2_out.casl: 12: POP GR1 @@ -35,8 +35,8 @@ Assemble ../../../../as/CMD/svc2_out.casl (1) ../../../../as/CMD/svc2_out.casl: 5: LAD GR1,OBUF #0004 #1210 #0005 #0013 -../../../../as/CMD/svc2_out.casl: 6: LAD GR2,LEN - #0006 #1220 +../../../../as/CMD/svc2_out.casl: 6: LD GR2,LEN + #0006 #1020 #0007 #0017 ../../../../as/CMD/svc2_out.casl: 7: SVC 2 #0008 #F000 @@ -45,10 +45,9 @@ Assemble ../../../../as/CMD/svc2_out.casl (1) #0018 #000A #000A #1210 #000B #0018 -../../../../as/CMD/svc2_out.casl: 9: LAD GR2,=1 - #0019 #0001 +../../../../as/CMD/svc2_out.casl: 9: LAD GR2,1 #000C #1220 - #000D #0019 + #000D #0001 ../../../../as/CMD/svc2_out.casl: 10: SVC 2 #000E #F000 #000F #0002 @@ -82,8 +81,8 @@ Executing machine codes #0000: FR (OF SF ZF): 000 #0000: Memory:::: #0000: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0000: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0000: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0000: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0000: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0000: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0000: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0000: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -129,8 +128,8 @@ Executing machine codes #0002: FR (OF SF ZF): 000 #0002: Memory:::: #0002: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0002: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0002: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0002: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0002: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0002: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0002: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0002: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -176,8 +175,8 @@ Executing machine codes #0004: FR (OF SF ZF): 000 #0004: Memory:::: #0004: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0004: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0004: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0004: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0004: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0004: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0004: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0004: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -223,8 +222,8 @@ Executing machine codes #0006: FR (OF SF ZF): 000 #0006: Memory:::: #0006: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0006: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0006: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0006: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0006: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0006: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0006: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0006: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -259,7 +258,7 @@ Executing machine codes #0008: Register:::: #0008: GR0: 0 = #0000 = 0000000000000000 #0008: GR1: 19 = #0013 = 0000000000010011 -#0008: GR2: 23 = #0017 = 0000000000010111 +#0008: GR2: 4 = #0004 = 0000000000000100 #0008: GR3: 0 = #0000 = 0000000000000000 #0008: GR4: 0 = #0000 = 0000000000000000 #0008: GR5: 0 = #0000 = 0000000000000000 @@ -270,8 +269,8 @@ Executing machine codes #0008: FR (OF SF ZF): 000 #0008: Memory:::: #0008: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0008: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0008: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0008: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0008: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0008: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0008: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0008: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -306,7 +305,7 @@ Executing machine codes abcd#000A: Register:::: #000A: GR0: 0 = #0000 = 0000000000000000 #000A: GR1: 19 = #0013 = 0000000000010011 -#000A: GR2: 23 = #0017 = 0000000000010111 +#000A: GR2: 4 = #0004 = 0000000000000100 #000A: GR3: 0 = #0000 = 0000000000000000 #000A: GR4: 0 = #0000 = 0000000000000000 #000A: GR5: 0 = #0000 = 0000000000000000 @@ -317,8 +316,8 @@ abcd#000A: Register:::: #000A: FR (OF SF ZF): 000 #000A: Memory:::: #000A: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#000A: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#000A: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#000A: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#000A: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #000A: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #000A: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #000A: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -353,7 +352,7 @@ abcd#000A: Register:::: #000C: Register:::: #000C: GR0: 0 = #0000 = 0000000000000000 #000C: GR1: 24 = #0018 = 0000000000011000 -#000C: GR2: 23 = #0017 = 0000000000010111 +#000C: GR2: 4 = #0004 = 0000000000000100 #000C: GR3: 0 = #0000 = 0000000000000000 #000C: GR4: 0 = #0000 = 0000000000000000 #000C: GR5: 0 = #0000 = 0000000000000000 @@ -364,8 +363,8 @@ abcd#000A: Register:::: #000C: FR (OF SF ZF): 000 #000C: Memory:::: #000C: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#000C: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#000C: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#000C: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#000C: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #000C: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #000C: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #000C: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -400,7 +399,7 @@ abcd#000A: Register:::: #000E: Register:::: #000E: GR0: 0 = #0000 = 0000000000000000 #000E: GR1: 24 = #0018 = 0000000000011000 -#000E: GR2: 25 = #0019 = 0000000000011001 +#000E: GR2: 1 = #0001 = 0000000000000001 #000E: GR3: 0 = #0000 = 0000000000000000 #000E: GR4: 0 = #0000 = 0000000000000000 #000E: GR5: 0 = #0000 = 0000000000000000 @@ -411,8 +410,8 @@ abcd#000A: Register:::: #000E: FR (OF SF ZF): 000 #000E: Memory:::: #000E: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#000E: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#000E: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#000E: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#000E: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #000E: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #000E: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #000E: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -448,7 +447,7 @@ abcd#000A: Register:::: #0010: Register:::: #0010: GR0: 0 = #0000 = 0000000000000000 #0010: GR1: 24 = #0018 = 0000000000011000 -#0010: GR2: 25 = #0019 = 0000000000011001 +#0010: GR2: 1 = #0001 = 0000000000000001 #0010: GR3: 0 = #0000 = 0000000000000000 #0010: GR4: 0 = #0000 = 0000000000000000 #0010: GR5: 0 = #0000 = 0000000000000000 @@ -459,8 +458,8 @@ abcd#000A: Register:::: #0010: FR (OF SF ZF): 000 #0010: Memory:::: #0010: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0010: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0010: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0010: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0010: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0010: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0010: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0010: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -506,8 +505,8 @@ abcd#000A: Register:::: #0011: FR (OF SF ZF): 000 #0011: Memory:::: #0011: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0011: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0011: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0011: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0011: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0011: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0011: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0011: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 @@ -553,8 +552,8 @@ abcd#000A: Register:::: #0012: FR (OF SF ZF): 000 #0012: Memory:::: #0012: adr : 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F -#0012: 0000: 7001 0000 7002 0000 1210 0013 1220 0017 F000 0002 1210 0018 1220 0019 F000 0002 -#0012: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0001 0000 0000 0000 0000 0000 0000 +#0012: 0000: 7001 0000 7002 0000 1210 0013 1020 0017 F000 0002 1210 0018 1220 0001 F000 0002 +#0012: 0010: 7120 7110 8100 0061 0062 0063 0064 0004 000A 0000 0000 0000 0000 0000 0000 0000 #0012: 0020: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0012: 0030: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 #0012: 0040: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 diff --git a/test/integration/casl2/misc_out_hello/Makefile b/test/integration/casl2/misc_out_hello/Makefile new file mode 100644 index 0000000..ea9a465 --- /dev/null +++ b/test/integration/casl2/misc_out_hello/Makefile @@ -0,0 +1,6 @@ +include ../CMD.mk # YACASL2DIR, CASL2 +CASL2FLAG = -slatd +ASDIR = $(YACASL2DIR)/as/MISC/out +ASFILE = $(ASDIR)/hello1.casl +CMD = $(CASL2) $(CASL2FLAG) $(ASFILE) +include ../TEST.mk diff --git a/test/integration/casl2/sum_10_h/0.txt b/test/integration/casl2/opt_h/0.txt similarity index 100% rename from test/integration/casl2/sum_10_h/0.txt rename to test/integration/casl2/opt_h/0.txt diff --git a/test/integration/casl2/sum_10_h/Makefile b/test/integration/casl2/opt_h/Makefile similarity index 100% rename from test/integration/casl2/sum_10_h/Makefile rename to test/integration/casl2/opt_h/Makefile diff --git a/test/integration/casl2/sum_10_opterr/0.txt b/test/integration/casl2/opt_opterr/0.txt similarity index 100% rename from test/integration/casl2/sum_10_opterr/0.txt rename to test/integration/casl2/opt_opterr/0.txt diff --git a/test/integration/casl2/sum_10_opterr/Makefile b/test/integration/casl2/opt_opterr/Makefile similarity index 100% rename from test/integration/casl2/sum_10_opterr/Makefile rename to test/integration/casl2/opt_opterr/Makefile diff --git a/test/integration/casl2/sum_10_s/0.txt b/test/integration/casl2/opt_s/0.txt similarity index 100% rename from test/integration/casl2/sum_10_s/0.txt rename to test/integration/casl2/opt_s/0.txt diff --git a/test/integration/casl2/sum_10_s/CMD.mk b/test/integration/casl2/opt_s/CMD.mk similarity index 100% rename from test/integration/casl2/sum_10_s/CMD.mk rename to test/integration/casl2/opt_s/CMD.mk diff --git a/test/integration/casl2/sum_10_s/Makefile b/test/integration/casl2/opt_s/Makefile similarity index 100% rename from test/integration/casl2/sum_10_s/Makefile rename to test/integration/casl2/opt_s/Makefile diff --git a/test/integration/casl2/sum_10_sL/0.txt b/test/integration/casl2/opt_sL/0.txt similarity index 100% rename from test/integration/casl2/sum_10_sL/0.txt rename to test/integration/casl2/opt_sL/0.txt diff --git a/test/integration/casl2/sum_10_sL/Makefile b/test/integration/casl2/opt_sL/Makefile similarity index 100% rename from test/integration/casl2/sum_10_sL/Makefile rename to test/integration/casl2/opt_sL/Makefile diff --git a/test/integration/casl2/sum_10_slA/0.txt b/test/integration/casl2/opt_slA/0.txt similarity index 100% rename from test/integration/casl2/sum_10_slA/0.txt rename to test/integration/casl2/opt_slA/0.txt diff --git a/test/integration/casl2/sum_10_slA/Makefile b/test/integration/casl2/opt_slA/Makefile similarity index 100% rename from test/integration/casl2/sum_10_slA/Makefile rename to test/integration/casl2/opt_slA/Makefile diff --git a/test/integration/casl2/sum_10_slaO/0.txt b/test/integration/casl2/opt_slaO/0.txt similarity index 100% rename from test/integration/casl2/sum_10_slaO/0.txt rename to test/integration/casl2/opt_slaO/0.txt diff --git a/test/integration/casl2/sum_10_slaO/Makefile b/test/integration/casl2/opt_slaO/Makefile similarity index 100% rename from test/integration/casl2/sum_10_slaO/Makefile rename to test/integration/casl2/opt_slaO/Makefile diff --git a/test/integration/casl2/sum_10_slaOn/0.txt b/test/integration/casl2/opt_slaOn/0.txt similarity index 100% rename from test/integration/casl2/sum_10_slaOn/0.txt rename to test/integration/casl2/opt_slaOn/0.txt diff --git a/test/integration/casl2/sum_10_slaOn/Makefile b/test/integration/casl2/opt_slaOn/Makefile similarity index 100% rename from test/integration/casl2/sum_10_slaOn/Makefile rename to test/integration/casl2/opt_slaOn/Makefile diff --git a/test/integration/casl2/sum_10_slaoT/0.txt b/test/integration/casl2/opt_slaoT/0.txt similarity index 100% rename from test/integration/casl2/sum_10_slaoT/0.txt rename to test/integration/casl2/opt_slaoT/0.txt diff --git a/test/integration/casl2/sum_10_slaoT/Makefile b/test/integration/casl2/opt_slaoT/Makefile similarity index 100% rename from test/integration/casl2/sum_10_slaoT/Makefile rename to test/integration/casl2/opt_slaoT/Makefile diff --git a/test/integration/casl2/sum_10_slaot/0.txt b/test/integration/casl2/opt_slaot/0.txt similarity index 100% rename from test/integration/casl2/sum_10_slaot/0.txt rename to test/integration/casl2/opt_slaot/0.txt diff --git a/test/integration/casl2/sum_10_slaot/Makefile b/test/integration/casl2/opt_slaot/Makefile similarity index 100% rename from test/integration/casl2/sum_10_slaot/Makefile rename to test/integration/casl2/opt_slaot/Makefile diff --git a/test/integration/casl2/sum_10_slaotd/0.txt b/test/integration/casl2/opt_slaotd/0.txt similarity index 100% rename from test/integration/casl2/sum_10_slaotd/0.txt rename to test/integration/casl2/opt_slaotd/0.txt diff --git a/test/integration/casl2/sum_10_slaotd/Makefile b/test/integration/casl2/opt_slaotd/Makefile similarity index 100% rename from test/integration/casl2/sum_10_slaotd/Makefile rename to test/integration/casl2/opt_slaotd/Makefile diff --git a/test/integration/casl2/svc2_out/Makefile b/test/integration/casl2/svc2_out/Makefile deleted file mode 100644 index 7a21994..0000000 --- a/test/integration/casl2/svc2_out/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -include ../CMD.mk # YACASL2DIR, CASL2 -CASL2FLAG = -slatd -ASDIR = $(YACASL2DIR)/as/CMD -ASFILE = $(ASDIR)/svc2_out.casl -CMD = $(CASL2) $(CASL2FLAG) $(ASFILE) $(IN) -include ../TEST.mk diff --git a/test/integration/comet2/svc2_out/0.txt b/test/integration/comet2/misc_out_hello1/0.txt similarity index 63% rename from test/integration/comet2/svc2_out/0.txt rename to test/integration/comet2/misc_out_hello1/0.txt index 33b36a3..dc0423c 100644 --- a/test/integration/comet2/svc2_out/0.txt +++ b/test/integration/comet2/misc_out_hello1/0.txt @@ -1,2 +1,2 @@ ../../../../comet2 a.o -abcd +Hello, World! \ No newline at end of file diff --git a/test/integration/comet2/misc_out_hello1/Makefile b/test/integration/comet2/misc_out_hello1/Makefile new file mode 100644 index 0000000..da52ddf --- /dev/null +++ b/test/integration/comet2/misc_out_hello1/Makefile @@ -0,0 +1,4 @@ +include ../CMD.mk # YACASL2DIR, CASL2 +ASDIR = $(YACASL2DIR)/as/MISC/out +ASFILE = $(ASDIR)/hello1.casl +include ../TEST.mk diff --git a/test/integration/comet2/misc_out_hello1/a.o b/test/integration/comet2/misc_out_hello1/a.o new file mode 100644 index 0000000..31e75bb Binary files /dev/null and b/test/integration/comet2/misc_out_hello1/a.o differ diff --git a/test/integration/comet2/svc2_out/Makefile b/test/integration/comet2/svc2_out/Makefile deleted file mode 100644 index ecef17b..0000000 --- a/test/integration/comet2/svc2_out/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../CMD.mk # YACASL2DIR, CASL2 -ASDIR = $(YACASL2DIR)/as/CMD -ASFILE = $(ASDIR)/svc2_out.casl -include ../TEST.mk diff --git a/test/integration/comet2/svc2_out/a.o b/test/integration/comet2/svc2_out/a.o index 1381ea4..2cd91af 100644 Binary files a/test/integration/comet2/svc2_out/a.o and b/test/integration/comet2/svc2_out/a.o differ diff --git a/test/unit/TEST.mk b/test/unit/TEST.mk index 7e49c83..4d473e9 100644 --- a/test/unit/TEST.mk +++ b/test/unit/TEST.mk @@ -11,9 +11,9 @@ SRCDIR = ../../../src INCLUDE = ../../../include CC = gcc CFLAGS = -g -Wall -I $(INCLUDE) -COMMONSRC = $(SRCDIR)/word.c $(SRCDIR)/struct.c $(SRCDIR)/hash.c $(SRCDIR)/cmd.c $(SRCDIR)/cerr.c -ASSRC = $(SRCDIR)/assemble.c $(SRCDIR)/token.c $(SRCDIR)/label.c $(SRCDIR)/macro.c -EXECSRC = $(SRCDIR)/exec.c $(SRCDIR)/dump.c +COMMONSRC = $(SRCDIR)/word.o $(SRCDIR)/struct.o $(SRCDIR)/hash.o $(SRCDIR)/cmd.o $(SRCDIR)/cerr.o +ASSRC = $(SRCDIR)/assemble.o $(SRCDIR)/token.o $(SRCDIR)/label.o $(SRCDIR)/macro.o +EXECSRC = $(SRCDIR)/exec.o $(SRCDIR)/dump.o ifeq "$(UCLASS)" "AS" SRC = $(COMMONSRC) $(ASSRC) @@ -33,6 +33,7 @@ clean: cleanall: clean @rm -f 0.txt a.out: $(SRC) $(TESTSRCFILE) + @make -C $(SRCDIR) @gcc $(CFLAGS) $(SRC) $(TESTSRCFILE) 0.txt 1.txt: a.out @./a.out >$@ 2>&1 diff --git a/test/unit/print_cmdtype_code/print_cmdtype_code.c b/test/unit/print_cmdtype_code/print_cmdtype_code.c index 9410051..35dba2c 100644 --- a/test/unit/print_cmdtype_code/print_cmdtype_code.c +++ b/test/unit/print_cmdtype_code/print_cmdtype_code.c @@ -11,3 +11,39 @@ int main(){ } return 0; } + +/* エラー番号とエラーメッセージ */ +CERRARRAY cerr[] = { + { 101, "label already defined" }, + { 102, "label table is full" }, + { 103, "label not found" }, + { 104, "label length is too long" }, + { 105, "no command in the line" }, + { 106, "operand count mismatch" }, + { 107, "no label in START" }, + { 108, "not command of operand \"r\"" }, + { 109, "not command of operand \"r1,r2\"" }, + { 110, "not command of operand \"r,adr[,x]\"" }, + { 111, "not command of operand \"adr[,x]\"" }, + { 112, "not command of no operand" }, + { 113, "command not defined" }, + { 114, "not integer" }, + { 115, "not hex" }, + { 116, "out of hex range" }, + { 117, "operand is too many" }, + { 118, "operand length is too long" }, + { 119, "out of COMET II memory" }, + { 120, "GR0 in operand x" }, + { 121, "cannot get operand token" }, + { 122, "cannot create hash table" }, + { 123, "illegal string" }, + { 124, "more than one character in literal" }, + { 201, "execute - out of COMET II memory" }, + { 202, "SVC input - out of Input memory" }, + { 203, "SVC output - out of COMET II memory" }, + { 204, "Program Register (PR) - out of COMET II memory" }, + { 205, "Stack Pointer (SP) - cannot allocate stack buffer" }, + { 206, "Address - out of COMET II memory" }, + { 207, "Stack Pointer (SP) - out of COMET II memory" }, + { 0, NULL }, +}; diff --git a/test/unit/print_code_type/print_code_type.c b/test/unit/print_code_type/print_code_type.c index e6a96db..7a925ff 100644 --- a/test/unit/print_code_type/print_code_type.c +++ b/test/unit/print_code_type/print_code_type.c @@ -1,5 +1,8 @@ #include "casl2.h" -int main(){ +#include "cerr.h" + +int main() +{ puts("== CODE_TYPE TABLE =="); create_code_type(); print_code_type(); @@ -11,3 +14,39 @@ int main(){ } return 0; } + +/* エラー番号とエラーメッセージ */ +CERRARRAY cerr[] = { + { 101, "label already defined" }, + { 102, "label table is full" }, + { 103, "label not found" }, + { 104, "label length is too long" }, + { 105, "no command in the line" }, + { 106, "operand count mismatch" }, + { 107, "no label in START" }, + { 108, "not command of operand \"r\"" }, + { 109, "not command of operand \"r1,r2\"" }, + { 110, "not command of operand \"r,adr[,x]\"" }, + { 111, "not command of operand \"adr[,x]\"" }, + { 112, "not command of no operand" }, + { 113, "command not defined" }, + { 114, "not integer" }, + { 115, "not hex" }, + { 116, "out of hex range" }, + { 117, "operand is too many" }, + { 118, "operand length is too long" }, + { 119, "out of COMET II memory" }, + { 120, "GR0 in operand x" }, + { 121, "cannot get operand token" }, + { 122, "cannot create hash table" }, + { 123, "illegal string" }, + { 124, "more than one character in literal" }, + { 201, "execute - out of COMET II memory" }, + { 202, "SVC input - out of Input memory" }, + { 203, "SVC output - out of COMET II memory" }, + { 204, "Program Register (PR) - out of COMET II memory" }, + { 205, "Stack Pointer (SP) - cannot allocate stack buffer" }, + { 206, "Address - out of COMET II memory" }, + { 207, "Stack Pointer (SP) - out of COMET II memory" }, + { 0, NULL }, +};