X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fyacasl2.texi;h=a097830e5f2ba839699d77f23c74b8127d39db6b;hb=e934f979236c43e098be7b500e7bc11103911630;hp=a0bec201fc1c7b06417a0572882c751519ddcbd5;hpb=42426ae7769b50b3828c14cff716973b677bbb3e;p=YACASL2.git diff --git a/doc/yacasl2.texi b/doc/yacasl2.texi index a0bec20..a097830 100644 --- a/doc/yacasl2.texi +++ b/doc/yacasl2.texi @@ -33,16 +33,16 @@ Copyright @copyright{} 2010 j8takagi @end ifnottex @menu -* YACASL2の概要:: -* YACASL2のインストール:: -* YACASL2の使い方:: -* YACASL2コマンドマニュアル:: -* CASL2LIBマニュアル:: +* About:: +* Install:: +* Usage:: +* Command Manual:: +* CASL2LIB Manual:: @end menu @contents -@node YACASL2の概要, YACASL2のインストール, Top, Top +@node About, Install, Top, Top @chapter YACASL2の概要 YACASL2は、Linux上で動作するオープンソースのCASL II処理系です。CASL IIは情報処理試験で用いられるアセンブラ言語で、次の資料により仕様が公開されています。 @@ -78,95 +78,84 @@ YACASL2は、「ふつうの処理系」として動作します。ほかの多 実行時のメモリの内容 @end itemize -出力された動作内容は、GNU/Linuxのさまざまなツール、たとえば@command{cat}、@command{less}、@command{grep}、@command{wc}などを使って解析できます。 +出力された動作内容は、GNU/Linuxのさまざまなツール、たとえば@kbd{cat}、@kbd{less}、@kbd{grep}、@kbd{wc}などを使って解析できます。 YACASL2の操作は、端末を開いてコマンドを入力・実行することで行います。 @unnumberedsec 要件 -YACASL2は、Linux上で動作します。現在動作を確認しているのは、次のディストリビューションです。 +YACASL2は、LinuxやMac OS Xなど、UNIX系のOS上で動作します。現在動作を確認しているのは、次の環境です。 @itemize @bullet @item -Ubuntu Linux 9.04 / 8.04 +Ubuntu Linux 10.10 @item Vine Linux 4.2 + +@item +Mac OS X 10.6 @end itemize -インストール時に、@command{tar}、@command{gcc}、@command{make}が必要です。 +インストール時に、@kbd{tar}、@kbd{gcc}、@kbd{make}が必要です。Linuxの場合は、標準でインストールされていることが多いと思います。Mac OS Xの場合、@code{Xcode}をインストールしてください。 -@node YACASL2のインストール, YACASL2の使い方, YACASL2の概要, Top +@node Install, Usage, About, Top @chapter YACASL2のインストール YACASL2をインストールするには、Linux上で次の作業をします。 -@enumerate - -@item -YACASL2ファイルのダウンロード - -@item -YACASL2ファイルの検証 - -@item -YACASL2ファイルの展開 - -@item -@command{casl2}、@command{comet2}、@command{dumpword}のビルド - -@item -@command{casl2}の実行テスト - -@item -詳細なテスト - -@item -環境変数@var{PATH}の設定 -@end enumerate +@menu +* Download:: YACASL2ファイルのダウンロード +* Verify:: YACASL2ファイルの検証 +* Expand:: YACASL2ファイルの展開 +* Build:: @kbd{casl2}、@kbd{comet2}、@kbd{dumpword}のビルド +* Simple Test:: @kbd{casl2}の実行テスト +* Detail Test:: 詳細なテスト +* Path Setting:: 環境変数@code{PATH}の設定 +@end menu +@node Download, Verify, Install, Install @section YACASL2ファイルのダウンロード -@uref{http://github.com/j8takagi/YACASL2, GitHub/j8takagi/YACASL2}の@uref{http://github.com/j8takagi/YACASL2/downloads, ダウンロードページ}から最新版のtgzファイルをダウンロードします(2010年3月6日現在、@var{v0.1}の@file{j8takagi-YACASL2-6323ce4.tar.gz})。 - -続けて、対応する@file{md5sum}フィルをダウンロードします(2010年3月6日現在、@file{j8takagi-YACASL2-6323ce4.tar.gz.md5sum})。 - -@section YACASL2ファイルの検証 -ダウンロードが完了したら、@command{md5sum}と@command{diff}で正しくファイルがダウンロードができているかを検証します。 +次の場所から最新版の@file{tar.gz}ファイルをダウンロードします。 @iftex @cartouche @end iftex -@example -$ @command{md5sum yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -} -Files yacasl2.tar.gz.md5sum and - are identical -@end example +@quotation +@uref{http://github.com/j8takagi/YACASL2, GitHub/j8takagi/YACASL2}の@uref{http://github.com/j8takagi/YACASL2/downloads, ダウンロードページ} +@end quotation @iftex @end cartouche @end iftex +続けて、対応する@file{md5sum}ファイルをダウンロードします(2010年3月6日現在、@file{j8takagi-YACASL2-6323ce4.tar.gz.md5sum})。 + +@node Verify, Expand, Download, Install +@section YACASL2ファイルの検証 + +ダウンロードが完了したら、@kbd{md5sum}と@kbd{diff}で正しくファイルがダウンロードができているかを検証します。 + +@example +$ @kbd{md5sum yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -} +Files yacasl2.tar.gz.md5sum and - are identical +@end example + +@node Expand, Build, Verify, Install @section YACASL2ファイルの展開 YACASL2ファイルをダウンロードしたら、次のコマンドで展開します。 -@iftex -@cartouche -@end iftex @example -$ @command{tar xvzf yacasl2.tar.gz} +$ @kbd{tar xvzf yacasl2.tar.gz} @end example -@iftex -@end cartouche -@end iftex -@section @command{casl2}、@command{comet2}、@command{dumpword}のビルド +@node Build, Simple Test, Expand, Install +@section @kbd{casl2}、@kbd{comet2}、@kbd{dumpword}のビルド -展開したら、次のコマンドで@command{casl2}、@command{comet2}、@command{dumpword}をビルドします。 +展開したら、次のコマンドで@kbd{casl2}、@kbd{comet2}、@kbd{dumpword}をビルドします。 -@iftex -@cartouche -@end iftex @example -$ @command{cd yacasl2} -$ @command{make} +$ @kbd{cd yacasl2} +$ @kbd{make} make -C src make[1]: Entering directory ‘/home/kazubito/yacasl2/src’ gcc -c -g -Wall -I ../include casl2.c @@ -190,35 +179,25 @@ gcc -c -g -Wall -I ../include dumpword.c gcc -g -Wall -I ../include -o ../dumpword dumpword.o word.o cerr.o make[1]: Leaving directory ‘/home/kazubito/yacasl2/src’ @end example -@iftex -@end cartouche -@end iftex -@section @command{casl2}の実行テスト +@node Simple Test, Detail Test, Build, Install +@section @kbd{casl2}の実行テスト ビルドしたら、次のコマンドが正常に実行できるかを確認します。 正常に実行された場合は、「Hello, World!」と表示されます。 -@iftex -@cartouche -@end iftex @example -$ @command{./casl2 as/hello.casl} +$ @kbd{./casl2 as/hello.casl} Hello, World! @end example -@iftex -@end cartouche -@end iftex +@node Detail Test, Path Setting, Simple Test, Install @section 詳細なテスト 次のコマンドを実行すると、正常にビルドできているかどうかを詳細にテストできます。 -@iftex -@cartouche -@end iftex @example -$ @command{make check} +$ @kbd{make check} 194 / 194 tests passed. Details in /home/kazubito/yacasl2/test/integra tion/casl2/Test.log All tests are succeded. @@ -229,64 +208,52 @@ All tests are succeded. /dumpword/Test.log All tests are succeded. @end example -@iftex -@end cartouche -@end iftex -@section 環境変数@var{PATH}の設定 +@node Path Setting,, Detail Test, Install +@section 環境変数@code{PATH}の設定 -環境変数@var{PATH}にYACASL2のディレクトリを追加すると、どのディレクトリでも@command{casl2}、@command{comet2}、@command{dumpword}を実行できます。 +環境変数@code{PATH}にYACASL2のディレクトリを追加すると、どのディレクトリでも@kbd{casl2}、@kbd{comet2}、@kbd{dumpword}を実行できます。 環境変数の設定方法は使っているシェルによって異なります。シェルは、次のコマンドで確認できます。 -@iftex -@cartouche -@end iftex @example -$ @command{echo $SHELL} +$ @kbd{echo $SHELL} /bin/bash @end example -@iftex -@end cartouche -@end iftex -現在もっとも多く使われているシェルは、BASHでしょう。BASHでは、次のコマンドを実行すると環境変数@var{PATH}にYACASL2のディレクトリが追加されます。 +現在もっとも多く使われているシェルは、BASHでしょう。BASHでは、次のコマンドを実行すると環境変数@code{PATH}にYACASL2のディレクトリが追加されます。 -@iftex -@cartouche -@end iftex @example -$ @command{PATH=$PATH:~/yacasl2 && export PATH} +$ @kbd{PATH=$PATH:~/yacasl2 && export PATH} @end example -@iftex -@end cartouche -@end iftex -シェルの初期設定ファイルに上記のコマンドを追加すれば、今後ログインした後は自動的にどのディレクトリでも @command{casl2}、@command{comet2}、@command{dumpword}を実行できます。BASHではホームディレクトリにある@file{.bashrc}が初期設定ファイルのため、次のコマンドで追加されます。 +シェルの初期設定ファイルに上記のコマンドを追加すれば、今後ログインした後は自動的にどのディレクトリでも @kbd{casl2}、@kbd{comet2}、@kbd{dumpword}を実行できます。BASHではホームディレクトリにある@file{.bashrc}が初期設定ファイルのため、次のコマンドで追加されます。 -@iftex -@cartouche -@end iftex @example -$ @command{echo ’PATH=$PATH:~/yacasl2 && export PATH’ >>~/.bashrc} +$ @kbd{echo ’PATH=$PATH:~/yacasl2 && export PATH’ >>~/.bashrc} @end example -@iftex -@end cartouche -@end iftex -@node YACASL2の使い方, YACASL2コマンドマニュアル, YACASL2のインストール, Top -@chapter YACASL2 の使い方 +@node Usage, Command Manual, Install, Top +@chapter YACASL2の使い方 YACASL2 は、テキストファイルに記述されたCASLプログラムを処理します。以下の例で用いられるCASLプログラムのファイルは、テキストエディタなどで作成してください。また、インストールしたディレクトリの中にある@file{as}ディレクトリからコピーして作成することもできます。 + +@menu +* Simple Output:: 実行結果の出力だけを表示 +* Assemble Result:: アセンブル結果の確認 +* Register and Memory:: 実行時のレジスタとメモリを表示 +* Only Assemble:: アセンブルと実行を別に行う +* Analyze Word:: 1語の解析 +* CASL2lib:: CASL2LIBマニュアル +@end menu + +@node Simple Output, Assemble Result, Usage, Usage @section 実行結果の出力だけを表示 インストール時にコマンド実行の確認に使った@file{hello.casl}は、次のような内容です。CASL IIのマクロ命令OUTは、文字列を出力します。 -@iftex -@cartouche -@end iftex @example -$ @command{cat hello.casl} +$ @kbd{cat hello.casl} MAIN START OUT OBUF,LEN RET @@ -294,30 +261,18 @@ OBUF DC ’Hello, World!’ LEN DC 13 END @end example -@iftex -@end cartouche -@end iftex 次のコマンドを実行すると、CASL II のアセンブルと仮想マシン COMET II 上での実行が連続で行われ、文字列が出力されます。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 hello.casl} +$ @kbd{casl2 hello.casl} Hello, World! @end example -@iftex -@end cartouche -@end iftex @file{addl.casl}は、3と1の和を求めます。 -@iftex -@cartouche -@end iftex @example -$ @command{cat addl.casl} +$ @kbd{cat addl.casl} ;;; ADDL r,adr MAIN START LD GR1,A @@ -327,76 +282,25 @@ A DC 3 B DC 1 END @end example -@iftex -@end cartouche -@end iftex このプログラムには出力命令がないため、オプションなしで実行した場合には結果が出力されません。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 addl.casl} +$ @kbd{casl2 addl.casl} $ @end example -@iftex -@end cartouche -@end iftex 実行内容を確認するには、後述のようにCPU 内にあるレジスタやメモリの内容を表示するか、結果を出力するための処理を追加する必要があります。 -@file{sum_10.casl}は、1から10までの整数の和を求めます。 - -@iftex -@cartouche -@end iftex -@example -$ @command{cat sum_10.casl} -;;; sum_10.casl -;;; 出力 GR0: 1から10までの整数をすべて加算した値 -MAIN START - PUSH 0,GR1 - LAD GR0,0 ; GR0を初期化 - LD GR1,FST ; GR1に初項を転送 -LOOP ADDL GR0,GR1 ; ループ先頭 - ADDL GR1,STEP ; GR1 <- GR1 + 公差 - CPL GR1,LST ; GR1が末項より大きい場合は終了 - JPL FIN ; ↓ - JUMP LOOP ; ループ終端 -FIN POP GR1 - RET -FST DC 1 ; 初項 -LST DC 10 ; 末項 -STEP DC 1 ; 公差 - END -@end example -@iftex -@end cartouche -@end iftex - -このプログラムも、オプションなしで実行した場合には結果が出力されません。 -@iftex -@cartouche -@end iftex -@example -$ @command{casl2 sum_10.casl} -$ -@end example -@iftex -@end cartouche -@end iftex - +@node Assemble Result, Register and Memory, Simple Output, Usage @section アセンブル結果の確認 + casl2の処理途中で行われるアセンブルの結果を表示するには、オプション@option{-a}を指定します。また、ラベルとアドレスの対応表を表示するには、オプション@option{-l}を指定します。 次のコマンドでは@file{hello.casl}の、ラベルとアドレスの対応表と、アセンブル結果と、実行結果が表示されます。OUTはアセンブラ命令で複数の機械語命令で構成されているため、命令行1行に対して、複数行のコードが生成されます。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -a -l hello.casl} +$ @kbd{casl2 -a -l hello.casl} Assemble hello.casl (0) @@ -449,17 +353,11 @@ hello.casl: 5:LEN DC 13 hello.casl: 6: END Hello, World! @end example -@iftex -@end cartouche -@end iftex @file{addl.casl}の、ラベルとアドレスの対応表と、アセンブル結果は、次のようになります。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -a -l addl.casl} +$ @kbd{casl2 -a -l addl.casl} Assemble addl.casl (0) @@ -485,24 +383,26 @@ addl.casl: 7:B DC 1 #0006 #0001 addl.casl: 8: END @end example -@iftex -@end cartouche -@end iftex なお、オプション@option{-A}を指定すると、アセンブル結果が表示される時点で処理が終了します。仮想マシンCOMET II での実行は行われません。 +@node Register and Memory, Only Assemble, Assemble Result, Usage @section 実行時のレジスタとメモリを表示 + YACASL2では実行中のCPUのレジスタとメモリの内容をそれぞれ、@option{-t}と@option{-d}を指定することで表示できます。 また、@option{-M}で、仮想マシンCOMET II のメモリ容量を語(16 ビット)単位で指定できます。小さいプログラムを実行するときは、メモリ容量を小さくすれば結果が見やすくなります。 +@menu +* Register Specify:: 特定のレジスタを表示 +* Ending Value:: プログラム終了時の値を表示 +* Step Count:: プログラムのステップ数を表示 +@end menu + @file{addl.casl}に必要なメモリ容量は8語のため、次のようにCPUのレジスタとメモリの内容を表示できます。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -t -d -M8 addl.casl | less} +$ @kbd{casl2 -t -d -M8 addl.casl | less} Assemble addl.casl (0) @@ -555,26 +455,18 @@ Executing machine codes #0004: adr : 0000 0001 0002 0003 0004 0005 0006 0007 #0004: 0000: 1010 0005 2210 0006 8100 0003 0001 0000 @end example -@iftex -@end cartouche -@end iftex +@node Register Specify, Ending Value, Register and Memory, Register and Memory @subsection 特定のレジスタを表示 -@file{addl.casl}のレジスタやメモリの中で、実行中に値が変化しているのはGR1だけです。こうした場合は、@command{grep}を使って表示される内容を絞り込むことで動作を検証しやすくなります。 +@file{addl.casl}のレジスタやメモリの中で、実行中に値が変化しているのはGR1だけです。こうした場合は、@kbd{grep}を使って表示される内容を絞り込むことで動作を検証しやすくなります。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -t addl.casl | grep 'GR1:'} +$ @kbd{casl2 -t addl.casl | grep 'GR1:'} #0000: GR1: 0 = #0000 = 0000000000000000 #0002: GR1: 3 = #0003 = 0000000000000011 #0004: GR1: 4 = #0004 = 0000000000000100 @end example -@iftex -@end cartouche -@end iftex この内容を、先に出力したアセンブル結果と引き比べてください。 次の表のように、PRとGR1、命令行が対応していることがわかります。 @@ -591,92 +483,83 @@ $ @command{casl2 -t addl.casl | grep 'GR1:'} @tab @code{ADDL GR1,B} @end multitable +@node Ending Value, Step Count, Register Specify, Register and Memory @subsection プログラム終了時の値を表示 -@command{grep}と@command{tail}を組み合わせれば、プログラム終了時の値を表示できます。 +@kbd{grep}と@kbd{tail}を組み合わせれば、プログラム終了時の値を表示できます。 + +@file{addl.casl}でプログラム終了時の値を確認するには、次のようにします。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -t addl.casl | grep 'GR1:' | tail -1} +$ @kbd{casl2 -t addl.casl | grep 'GR1:' | tail -1} #0004: GR1: 4 = #0004 = 0000000000000100 @end example -@iftex -@end cartouche -@end iftex -@iftex -@cartouche -@end iftex +@file{sum_10.casl}は、1から10までの整数の和を求めます。 + +@example +$ @kbd{cat sum_10.casl} +;;; sum_10.casl +;;; 出力 GR0: 1から10までの整数をすべて加算した値 +MAIN START + PUSH 0,GR1 + LAD GR0,0 ; GR0を初期化 + LD GR1,FST ; GR1に初項を転送 +LOOP ADDL GR0,GR1 ; ループ先頭 + ADDL GR1,STEP ; GR1 <- GR1 + 公差 + CPL GR1,LST ; GR1が末項より大きい場合は終了 + JPL FIN ; ↓ + JUMP LOOP ; ループ終端 +FIN POP GR1 + RET +FST DC 1 ; 初項 +LST DC 10 ; 末項 +STEP DC 1 ; 公差 + END +@end example + +@file{sum_10.casl}でファイル終了時の値を確認するには、次のようにします。 + @example -$ @command{casl2 -t sum_10.casl | grep 'GR0:' | tail -1} +$ @kbd{casl2 -t sum_10.casl | grep 'GR0:' | tail -1} #0010: GR0: 55 = #0037 = 0000000000110111 = '7' @end example -@iftex -@end cartouche -@end iftex +@node Step Count,, Ending Value, Register and Memory @subsection プログラムのステップ数を表示 -@command{grep}と@command{wc}を組み合わせれば、プログラムのステップ数を表示できます。 +@kbd{grep}と@kbd{wc}を組み合わせれば、プログラムのステップ数を表示できます。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -t hello.casl | grep 'GR1:' | wc -l} +$ @kbd{casl2 -t hello.casl | grep 'GR1:' | wc -l} 11 @end example -@iftex -@end cartouche -@end iftex -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -t addl.casl | grep 'GR1:' | wc -l} +$ @kbd{casl2 -t addl.casl | grep 'GR1:' | wc -l} 3 @end example -@iftex -@end cartouche -@end iftex @file{sum_10.casl}はプログラム内にループがあるため、ステップ数が大きくなります。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -t sum_10.casl | grep 'GR0:' | wc -l} +$ @kbd{casl2 -t sum_10.casl | grep 'GR0:' | wc -l} 54 @end example -@iftex -@end cartouche -@end iftex +@node Only Assemble, Analyze Word, Register and Memory, Usage @section アセンブルと実行を別に行う -@command{casl2}に@option{-O}@file{ファイル名}を指定すると、オブジェクトファイルを作成できます。 +@kbd{casl2}に@option{-O}@file{ファイル名}を指定すると、オブジェクトファイルを作成できます。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 -Ohello.o hello.casl} +$ @kbd{casl2 -Ohello.o hello.casl} @end example -@iftex -@end cartouche -@end iftex -作成されたオブジェクトファイルの内容は、@command{od}を使って確認できます。テキストファイルではないため、@command{cat}などでは確認できません。 +作成されたオブジェクトファイルの内容は、@kbd{od}を使って確認できます。テキストファイルではないため、@kbd{cat}などでは確認できません。 -@iftex -@cartouche -@end iftex @example -$ @command{od -t x2 hello.o} +$ @kbd{od -t x2 hello.o} 0000000 7001 0000 7002 0000 1210 0013 1220 0020 0000020 f000 0002 1210 0021 1220 0022 f000 0002 0000040 7120 7110 8100 0048 0065 006c 006c 006f @@ -684,65 +567,40 @@ $ @command{od -t x2 hello.o} 0000100 000d 000a 0001 0000106 @end example -@iftex -@end cartouche -@end iftex -オブジェクトファイルの実行には、@command{comet2}を使います。 +オブジェクトファイルの実行には、@kbd{comet2}を使います。 -@iftex -@cartouche -@end iftex @example -$ @command{comet2 hello.o} +$ @kbd{comet2 hello.o} Hello, World! @end example -@iftex -@end cartouche -@end iftex +@node Analyze Word, CASL2lib, Only Assemble, Usage @section 1語の解析 CASL IIでは、1語(16ビット)を単位としてデータが処理されます。 -@command{dumpword}は、指定した1語を10進数、16進数、2進数で表示します。 +@kbd{dumpword}は、指定した1語を10進数、16進数、2進数で表示します。 -@iftex -@cartouche -@end iftex @example -$ @command{dumpword 72} +$ @kbd{dumpword 72} 72: 72 = #0048 = 0000000001001000 = 'H' @end example -@iftex -@end cartouche -@end iftex マイナスの数は、次のように指定します。 -@iftex -@cartouche -@end iftex @example -$ @command{dumpword -- -72} +$ @kbd{dumpword -- -72} -72: -72 = #FFB8 = 1111111110111000 @end example -@iftex -@end cartouche -@end iftex 16進数は、次のように指定します。 -@iftex -@cartouche -@end iftex @example -$ @command{dumpword '#0048'} +$ @kbd{dumpword '#0048'} #0048: 72 = #0048 = 0000000001001000 = 'H' @end example -@iftex -@end cartouche -@end iftex +@node CASL2lib,, Analyze Word, Usage @section CASL2ライブラリの使用 YACASL2の@file{as/casl2lib}ディレクトリには、CASL IIで記述されたライブラリファイルが格納されています。 @@ -765,40 +623,28 @@ YACASL2の@file{as/casl2lib}ディレクトリには、CASL IIで記述された @subsection 数値を出力する -3と1の和を求める@file{addl.casl}で演算結果を出力するには、まず@file{addl.casl}を編集します。CASL IIの@command{CALL}命令で@command{OUTL}を副プログラムとして呼び出すようにします。 +3と1の和を求める@file{addl.casl}で演算結果を出力するには、まず@file{addl.casl}を編集します。CASL IIの@kbd{CALL}命令で@kbd{OUTL}を副プログラムとして呼び出します。 -@iftex -@cartouche -@end iftex @example -$ @command{cat addl_outl.casl} +$ @kbd{cat addl_outl.casl} MAIN START LD GR1,A ADDL GR1,B - @strong{CALL OUTL} + @emph{CALL OUTL} RET A DC 3 B DC 1 END @end example -@iftex -@end cartouche -@end iftex -変更したら@command{casl2}を、複数のファイルを指定して実行します。 +変更したら@kbd{casl2}を、複数のファイルを指定して実行します。 -@iftex -@cartouche -@end iftex @example -$ @command{casl2 addl_outl.casl ~/yacasl2/as/casl2lib/outl.casl} +$ @kbd{casl2 addl_outl.casl ~/yacasl2/as/casl2lib/outl.casl} 4 @end example -@iftex -@end cartouche -@end iftex -@node YACASL2コマンドマニュアル,CASL2LIBマニュアル,YACASL2の使い方,TOP +@node Command Manual,CASL2LIB Manual,Usage,TOP @chapter YACASL2コマンドマニュアル @cindex YACASL2コマンドマニュアル @@ -812,26 +658,26 @@ YACASL2のコマンドとオプションについて解説します。 @end menu @node casl2 -@section @command{casl2} +@section @kbd{casl2} @pindex casl2 @cindex casl2 -@command{casl2}は、引数として指定されたCASLファイルをアセンブルし、仮想マシンCOMET II上で実行します。CASLファイルは、アセンブラ言語CASL IIで記述されたテキストファイルです。引数が指定されない場合は、エラーメッセージを表示して終了します。 +@kbd{casl2}は、引数として指定されたCASLファイルをアセンブルし、仮想マシンCOMET II上で実行します。CASLファイルは、アセンブラ言語CASL IIで記述されたテキストファイルです。引数が指定されない場合は、エラーメッセージを表示して終了します。 @example -$ @command{casl2 hello.casl} +$ @kbd{casl2 hello.casl} @end example -副プログラムを呼び出す場合は、複数のCASLファイルを指定することもできます。 +複数のCASLファイルを指定することで、副プログラムを呼び出せます。 @example -$ @command{casl2 addl_outl.casl ~/yacasl2/as/casl2lib/outl.casl} +$ @kbd{casl2 addl_outl.casl ~/yacasl2/as/casl2lib/outl.casl} @end example @unnumberedsubsec オプション -@command{casl2}は、次のオプションを指定できます。 +@kbd{casl2}は、次のオプションを指定できます。 @table @option @item -s @@ -856,11 +702,11 @@ CASLファイルの内容を表示します。 @item -o @itemx --assembleout -アセンブル結果をオブジェクトファイル@file{}に出力し、ほかの作業を続行します。出力されたオブジェクトファイルは、@command{comet2}で実行できます。オブジェクトファイルを指定しない場合、出力先は@file{a.o}です。オブジェクトファイルは1つだけ指定できます。 +アセンブル結果をオブジェクトファイル@file{}に出力し、ほかの作業を続行します。出力されたオブジェクトファイルは、@kbd{comet2}で実行できます。オブジェクトファイルを指定しない場合、出力先は@file{a.o}です。オブジェクトファイルは1つだけ指定できます。 @item -O @itemx --assembleoutonly -アセンブル結果をオブジェクトファイル@file{}に出力し、終了します。出力されたオブジェクトファイルは、@command{comet2}で実行できます。オブジェクトファイルを指定しない場合、出力先は@file{a.o}です。オブジェクトファイルは1つだけ指定できます。 +アセンブル結果をオブジェクトファイル@file{}に出力し、終了します。出力されたオブジェクトファイルは、@kbd{comet2}で実行できます。オブジェクトファイルを指定しない場合、出力先は@file{a.o}です。オブジェクトファイルは1つだけ指定できます。 @item -t @itemx --trace @@ -885,26 +731,26 @@ CASLファイルの内容を表示します。 @item -h @itemx --help -@command{casl2}の使用方法を表示して終了します。 +@kbd{casl2}の使用方法を表示して終了します。 @end table @node comet2 -@section @command{comet2} +@section @kbd{comet2} @pindex comet2 @cindex comet2 -@command{comet2}は、引数として指定されたオブジェクトファイルを仮想マシンCOMET II上で実行します。オブジェクトファイルは、@command{casl}に@option{-o}または@option{-O}を指定して出力します。 +@kbd{comet2}は、引数として指定されたオブジェクトファイルを仮想マシンCOMET II上で実行します。オブジェクトファイルは、@kbd{casl}に@option{-o}または@option{-O}を指定して出力します。 @example -$ @command{comet2 hello.o} +$ @kbd{comet2 hello.o} @end example 引数で指定できるオブジェクトファイルは1つだけです。引数が指定されない場合は、エラーメッセージを表示して終了します。複数の引数を指定した場合、2番目以降の引数は無視されます。 @unnumberedsubsec オプション -@command{comet2}は、次のオプションを指定できます。 +@kbd{comet2}は、次のオプションを指定できます。 @table @option @@ -931,26 +777,26 @@ $ @command{comet2 hello.o} @item -h @itemx --help -@command{comet2}の使用方法を表示して終了します。 +@kbd{comet2}の使用方法を表示して終了します。 @end table @node dumpword -@section @command{dumpword} +@section @kbd{dumpword} @pindex dumpword @cindex dumpword -@command{dumpword}は、引数として指定された数値を、整数、#0000〜#FFFFの範囲の16進数、2進数で表示します。文字の組に該当する場合は、「 = 」のうしろに文字が表示されます。引数は、10進数または先頭に「#」の付いた16進数で指定します。表示される整数は、オプションにより-32,768〜32,767または0〜65,535の範囲です。オプションなしの場合は、-32,768〜32,767です。 +@kbd{dumpword}は、引数として指定された数値を、整数、#0000〜#FFFFの範囲の16進数、2進数で表示します。文字の組に該当する場合は、「 = 」のうしろに文字が表示されます。引数は、10進数または先頭に「#」の付いた16進数で指定します。表示される整数は、オプションにより-32,768〜32,767または0〜65,535の範囲です。オプションなしの場合は、-32,768〜32,767です。 @example -$ @command{dumpword 10} +$ @kbd{dumpword 10} @end example 引数で指定できる1つだけです。引数が指定されない場合は、使い方を表示して終了します。複数の引数を指定した場合、2番目以降の引数は無視されます。 @unnumberedsubsec オプション -@command{dumpword}は、次のオプションを指定できます。 +@kbd{dumpword}は、次のオプションを指定できます。 @table @option @@ -964,10 +810,10 @@ $ @command{dumpword 10} @item -h @itemx --help -@command{dumpword}の使用方法を表示して終了します。 +@kbd{dumpword}の使用方法を表示して終了します。 @end table -@node CASL2LIBマニュアル,,YACASL2コマンドマニュアル,TOP +@node CASL2LIB Manual,,Command Manual,TOP @chapter CASL2LIBマニュアル @menu @@ -990,7 +836,7 @@ $ @command{dumpword 10} @end menu @node ABS -@section @command{ABS} - @file{abs.casl} +@section @kbd{ABS} - @file{abs.casl} 入力された整数を絶対値に変換して出力 @unnumberedsubsec 入力 @@ -1017,28 +863,16 @@ $ @command{dumpword 10} なし @unnumberedsubsec 使用例 -@iftex -@cartouche -@end iftex @example @verbatiminclude ../as/casl2lib/test/abs/abs.casl @end example -@iftex -@end cartouche -@end iftex -@iftex -@cartouche -@end iftex @example @verbatiminclude ../as/casl2lib/test/abs/0.txt @end example -@iftex -@end cartouche -@end iftex @node ADDL32 -@section @command{ADDL32} - @file{addl32.casl} +@section @kbd{ADDL32} - @file{addl32.casl} 32ビットの値を、連続する2語の領域に格納 @unnumberedsubsec 入力 @@ -1066,31 +900,20 @@ $ @command{dumpword 10} @end table @unnumberedsubsec 使用例 -@iftex -@cartouche -@end iftex @example @verbatiminclude ../as/casl2lib/test/addl32/addl32_1.casl @end example -@iftex -@end cartouche -@end iftex -@iftex -@cartouche -@end iftex @example 4 9 -@iftex -@end cartouche -@end iftex +@end example @unnumberedsubsec 依存する副プログラム なし @node DIVA -@section @command{DIVA} -@file{diva.casl} +@section @kbd{DIVA} -@file{diva.casl} -32,767〜32,767の範囲にある整数の割算(筆算方式)を行う @unnumberedsubsec 入力 @@ -1122,7 +945,7 @@ $ @command{dumpword 10} @unnumberedsubsec 依存する副プログラム @itemize -@item @command{DIVL} +@item @kbd{DIVL} @end itemize @c @unnumberedsubsec 使用例 @@ -1147,7 +970,7 @@ $ @command{dumpword 10} @c @end iftex @node DIVL -@section @command{DIVL} - @file{divl.casl} +@section @kbd{DIVL} - @file{divl.casl} 0〜65,535の範囲にある整数の割算(筆算方式)を行う @unnumberedsubsec 入力 @@ -1181,50 +1004,44 @@ $ @command{dumpword 10} なし @unnumberedsubsec 使用例 -@iftex -@cartouche -@end iftex @example @verbatiminclude ../as/casl2lib/test/divl/divl0/divl0.casl @end example -@iftex -@end cartouche -@end iftex @node INL -@section @command{INL} - @file{inl.casl} +@section @kbd{INL} - @file{inl.casl} @node L2STR -@section @command{L2STR} - @file{l2str.casl} +@section @kbd{L2STR} - @file{l2str.casl} @node MAX -@section @command{MAX} - @file{max.casl} +@section @kbd{MAX} - @file{max.casl} @node MINIM -@section @command{MINIM} - @file{minim.casl} +@section @kbd{MINIM} - @file{minim.casl} @node MULA -@section @command{MULA} - @file{mula.casl} +@section @kbd{MULA} - @file{mula.casl} @node MULL -@section @command{MULL} - @file{mull.casl} +@section @kbd{MULL} - @file{mull.casl} @node OUTA -@section @command{OUTA} - @file{outa.casl} +@section @kbd{OUTA} - @file{outa.casl} @node OUTB -@section @command{OUTB} - @file{outb.casl} +@section @kbd{OUTB} - @file{outb.casl} @node OUTD_Q15 -@section @command{OUTD_Q15} - @file{outd_q15.casl} +@section @kbd{OUTD_Q15} - @file{outd_q15.casl} @node OUTL -@section @command{OUTL} - @file{outl.casl} +@section @kbd{OUTL} - @file{outl.casl} @node REV -@section @command{REV} - @file{rev.casl} +@section @kbd{REV} - @file{rev.casl} @node STR2L -@section @command{STR2L} - @file{str2l.casl} +@section @kbd{STR2L} - @file{str2l.casl} @bye