From b838ea73f37c8d8623aee6c3ebe36732d8858030 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Fri, 11 Feb 2011 00:20:13 +0900 Subject: [PATCH] =?utf8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3?= =?utf8?q?=E3=83=88=E3=81=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- doc/casl2lib/inl/call_inl.casl | 7 +++-- doc/yacasl2.html | 56 +++++++++++++++++++--------------- doc/yacasl2.texi | 22 ++++++------- 3 files changed, 47 insertions(+), 38 deletions(-) diff --git a/doc/casl2lib/inl/call_inl.casl b/doc/casl2lib/inl/call_inl.casl index 28c6a9c..b16d692 100644 --- a/doc/casl2lib/inl/call_inl.casl +++ b/doc/casl2lib/inl/call_inl.casl @@ -1,4 +1,5 @@ -;;; casl2 inl.casl ../casl2lib/inl.casl ../casl2lib/outl.casl +;;; casl2 -M1024 call_inl.casl $CASL2LIB/inl.casl $CASL2LIB/str2l.casl $CASL2LIB/mull.casl \ +;;; $CASL2LIB/outl.casl $CASL2LIB/divl.casl $CASL2LIB/rev.casl MAIN START LOOP CALL INL ; GR1に数値、GR0に文字列の長さ JOV OV @@ -18,8 +19,8 @@ LENOV OUT LENOVMSG,MLEN3 FIN RET OVMSG DC 'Over 65535' MLEN1 DC 10 -NANMSG DC 'Not A Number' -MLEN2 DC 12 +NANMSG DC 'Not integer' +MLEN2 DC 11 LENOVMSG DC 'Str too long. Stop' MLEN3 DC 18 END diff --git a/doc/yacasl2.html b/doc/yacasl2.html index 3a486fe..5617de3 100644 --- a/doc/yacasl2.html +++ b/doc/yacasl2.html @@ -1218,8 +1218,8 @@ MAIN START A DC -1 END -
$ casl2 call_abs.casl $CASL2LIBDIR/abs.casl $CASL2LIBDIR/outa.casl \
-  $CASL2LIBDIR/divl.casl $CASL2LIBDIR/rev.casl
+ 
$ casl2 call_abs.casl $CASL2LIB/abs.casl $CASL2LIB/outa.casl \
+  $CASL2LIB/divl.casl $CASL2LIB/rev.casl
 1
 
@@ -1291,8 +1291,8 @@ EMSG DC 'error' ELEN DC 5 END
-
$ casl2 call_diva.casl $CASL2LIBDIR/diva.casl $CASL2LIBDIR/divl.casl \
-  $CASL2LIBDIR/outa.casl $CASL2LIBDIR/abs.casl $CASL2LIBDIR/rev.casl
+ 
$ casl2 call_diva.casl $CASL2LIB/diva.casl $CASL2LIB/divl.casl \
+  $CASL2LIB/outa.casl $CASL2LIB/abs.casl $CASL2LIB/rev.casl
 -128
 -127
 
@@ -1356,8 +1356,8 @@ EMSG DC 'error' ELEN DC 5 END
-
$ casl2 call_divl.casl $CASL2LIBDIR/divl.casl $CASL2LIBDIR/outl.casl \
-  $CASL2LIBDIR/rev.casl
+ 
$ casl2 call_divl.casl $CASL2LIB/divl.casl $CASL2LIB/outl.casl \
+  $CASL2LIB/rev.casl
 256
 254
 
@@ -1396,29 +1396,37 @@ Up: CASL2LIB Manual

使用例

-
;; CASL2LIB > DIVLを呼び出し、65534 / 255 の商と剰余を表示
+ 

次のコマンドを実行すると、数値の入力が受け付けられ、入力された数値が表示される。 + +

;;; casl2 -M1024 call_inl.casl $CASL2LIB/inl.casl $CASL2LIB/str2l.casl  $CASL2LIB/mull.casl \
+;;;              $CASL2LIB/outl.casl $CASL2LIB/divl.casl $CASL2LIB/rev.casl
 MAIN    START
-BEGIN   LD      GR1,A
-        LD      GR2,B
-        CALL    DIVL
-        JOV     ERR
-        LD      GR1,GR0
-        CALL    OUTL
-        LD      GR1,GR3
+LOOP    CALL    INL             ; GR1に数値、GR0に文字列の長さ
+        JOV     OV
+        AND     GR0,GR0
+        JZE     FIN
+        CPL     GR0,=#FFFF
+        JZE     NAN
         CALL    OUTL
-        JUMP    FIN        
-ERR     OUT     EMSG,ELEN
+        JUMP    LOOP
+OV      CPL     GR0,=#FFFF
+        JZE     LENOV
+        OUT     OVMSG,MLEN1
+        JUMP    LOOP
+NAN     OUT     NANMSG,MLEN2
+        JUMP    LOOP
+LENOV   OUT     LENOVMSG,MLEN3
 FIN     RET
-A       DC      65534
-B       DC      255
-EMSG    DC      'error'
-ELEN	DC	5
+OVMSG   DC      'Over 65535'
+MLEN1   DC      10
+NANMSG  DC      'Not integer'
+MLEN2   DC      11
+LENOVMSG DC     'Str too long. Stop'
+MLEN3   DC      18
         END
 
-
$ casl2 call_divl.casl $CASL2LIBDIR/divl.casl $CASL2LIBDIR/outl.casl \
-  $CASL2LIBDIR/rev.casl
-256
-254
+ 
$ casl2 -M1024 call_inl.casl $CASL2LIB/inl.casl $CASL2LIB/str2l.casl $CASL2LIB/mull.casl \
+  $CASL2LIB/outl.casl $CASL2LIB/divl.casl $CASL2LIB/rev.casl
 
diff --git a/doc/yacasl2.texi b/doc/yacasl2.texi index 6a756d6..2c20e24 100644 --- a/doc/yacasl2.texi +++ b/doc/yacasl2.texi @@ -1034,8 +1034,8 @@ GR1を符号付き整数とみなし、絶対値に変換 @end example @example -$ @kbd{casl2 call_abs.casl $CASL2LIBDIR/abs.casl $CASL2LIBDIR/outa.casl \ - $CASL2LIBDIR/divl.casl $CASL2LIBDIR/rev.casl} +$ @kbd{casl2 call_abs.casl $CASL2LIB/abs.casl $CASL2LIB/outa.casl \ + $CASL2LIB/divl.casl $CASL2LIB/rev.casl} 1 @end example @@ -1091,8 +1091,8 @@ GR2が-32768 @end example @example -$ @kbd{casl2 call_diva.casl $CASL2LIBDIR/diva.casl $CASL2LIBDIR/divl.casl \ - $CASL2LIBDIR/outa.casl $CASL2LIBDIR/abs.casl $CASL2LIBDIR/rev.casl} +$ @kbd{casl2 call_diva.casl $CASL2LIB/diva.casl $CASL2LIB/divl.casl \ + $CASL2LIB/outa.casl $CASL2LIB/abs.casl $CASL2LIB/rev.casl} -128 -127 @end example @@ -1137,8 +1137,8 @@ GR2が0の場合、1 @end example @example -$ @kbd{casl2 call_divl.casl $CASL2LIBDIR/divl.casl $CASL2LIBDIR/outl.casl \ - $CASL2LIBDIR/rev.casl} +$ @kbd{casl2 call_divl.casl $CASL2LIB/divl.casl $CASL2LIB/outl.casl \ + $CASL2LIB/rev.casl} 256 254 @end example @@ -1170,15 +1170,15 @@ $ @kbd{casl2 call_divl.casl $CASL2LIBDIR/divl.casl $CASL2LIBDIR/outl.casl \ @end itemize @unnumberedsubsec 使用例 +次のコマンドを実行すると、数値の入力が受け付けられ、入力された数値が表示される。 + @example -@verbatiminclude casl2lib/divl/call_divl.casl +@verbatiminclude casl2lib/inl/call_inl.casl @end example @example -$ @kbd{casl2 call_divl.casl $CASL2LIBDIR/divl.casl $CASL2LIBDIR/outl.casl \ - $CASL2LIBDIR/rev.casl} -256 -254 +$ @kbd{casl2 -M1024 call_inl.casl $CASL2LIB/inl.casl $CASL2LIB/str2l.casl $CASL2LIB/mull.casl \ + $CASL2LIB/outl.casl $CASL2LIB/divl.casl $CASL2LIB/rev.casl} @end example @node L2STR, MAX, INL, CASL2LIB Manual -- 2.18.0