X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fyacasl2.texi;h=ae4366eca6fc9df4b66e8732bfd77d77672a4cb5;hb=00d4ba02d732a0ff14c402bddc14c713c9b392d8;hp=a6e2c571f4b7ec5576a0385d1aa1de318d36444d;hpb=08e463e73b83bebd0155bc2691f7fd87be4f75ee;p=YACASL2.git diff --git a/doc/yacasl2.texi b/doc/yacasl2.texi index a6e2c57..ae4366e 100644 --- a/doc/yacasl2.texi +++ b/doc/yacasl2.texi @@ -1,37 +1,44 @@ \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename yacasl2.info -@settitle YACASL2 - Linux上のCASL2処理系 +@settitle YACASL2 - Linux上のCASL II処理系 +@firstparagraphindent insert +@paragraphindent 1 @c %**end of header -@exampleindent 2 - @copying Copyright @copyright{} 2010 j8takagi @end copying +@exampleindent 2 + +@dircategory Basics +@direntry +* YACASL2: (yacasl2). +@end direntry + @titlepage -@title +@title YACASL2 +@subtitle Linux上のCASL II処理系 +@author j8takagi +@insertcopying @end titlepage + +@ifnottex @node Top +@end ifnottex @menu -* YACASL2の概要:about. -* YACASL2のインストール:install. -* YACASL2の使い方:tutorial. +* YACASL2の概要:: +* YACASL2のインストール:: +* YACASL2の使い方:: @end menu - -@c Output the table of contents at the beginning. @contents -@insertcopying - -@node about, install, Top, Top +@node YACASL2の概要, YACASL2のインストール, Top, Top @chapter YACASL2の概要 -@cindex chapter, first - YACASL2は、Linux上で動作するオープンソースのCASL II処理系です。CASL IIは情報処理試験で用いられるアセンブラ言語で、次の資料により仕様が公開されています。 @quotation @@ -75,9 +82,8 @@ Vine Linux 4.2 インストール時に、@command{tar}、@command{gcc}、@command{make}が必要です。 -@node install, tutorial, about, Top +@node YACASL2のインストール, YACASL2の使い方, YACASL2の概要, Top @chapter YACASL2のインストール - YACASL2をインストールするには、Linux上で次の作業をします。 @enumerate @@ -101,7 +107,7 @@ YACASL2をインストールするには、Linux上で次の作業をします 詳細なテスト @item -環境設定@var{PATH}の設定 +環境変数@var{PATH}の設定 @end enumerate 以下の操作は、端末を開きコマンドを実行します。 @@ -111,9 +117,9 @@ YACASL2をインストールするには、Linux上で次の作業をします @cartouche @example -$ @b{cd} -$ @b{wget somewhere/yacasl2.tar.gz} -$ @b{wget somewhere/yacasl2.tar.gz.md5sum} +$ @command{cd} +$ @command{wget somewhere/yacasl2.tar.gz} +$ @command{wget somewhere/yacasl2.tar.gz.md5sum} @end example @end cartouche @@ -125,7 +131,7 @@ $ @b{wget somewhere/yacasl2.tar.gz.md5sum} @cartouche @example -$ @b{md5sum yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -} +$ @command{md5sum yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -} Files yacasl2.tar.gz.md5sum and - are identical @end example @end cartouche @@ -136,7 +142,7 @@ Files yacasl2.tar.gz.md5sum and - are identical @cartouche @example -$ @b{tar xvzf yacasl2.tar.gz} +$ @command{tar xvzf yacasl2.tar.gz} @end example @end cartouche @@ -146,8 +152,8 @@ $ @b{tar xvzf yacasl2.tar.gz} @cartouche @example -$ @b{cd yacasl2} -$ @b{make} +$ @command{cd yacasl2} +$ @command{make} make -C src make[1]: Entering directory ‘/home/kazubito/yacasl2/src’ gcc -c -g -Wall -I ../include casl2.c @@ -180,7 +186,7 @@ make[1]: Leaving directory ‘/home/kazubito/yacasl2/src’ @cartouche @example -$ @b{./casl2 as/hello.casl} +$ @command{./casl2 as/hello.casl} Hello, World! @end example @end cartouche @@ -191,7 +197,7 @@ Hello, World! @cartouche @example -$ @b{make check} +$ @command{make check} 194 / 194 tests passed. Details in /home/kazubito/yacasl2/test/integra tion/casl2/Test.log All tests are succeded. @@ -204,38 +210,37 @@ All tests are succeded. @end example @end cartouche -@section 環境設定@var{PATH}の設定 +@section 環境変数@var{PATH}の設定 環境変数@var{PATH}にYACASL2のディレクトリーを追加すると、どのディレクトリーでも@command{casl2}、@command{comet2}、@command{dumpword}を実行できます。 -環境変数の設定方法は使っているシェルによって異なります。シェルは、次のコマンドで確認できます。現在もっとも多く使われているのは、BASHでしょう。 +環境変数の設定方法は使っているシェルによって異なります。シェルは、次のコマンドで確認できます。 @cartouche @example -$ @b{echo $SHELL} +$ @command{echo $SHELL} /bin/bash @end example @end cartouche -シェルがBASHの場合、次のコマンドを実行すると環境変数@var{PATH}にYACASL2のディレクトリーが追加されます。 +現在もっとも多く使われているシェルは、BASHでしょう。BASHでは、次のコマンドを実行すると環境変数@var{PATH}にYACASL2のディレクトリーが追加されます。 @cartouche @example -$ @b{PATH=$PATH:~/yacasl2 && export PATH} +$ @command{PATH=$PATH:~/yacasl2 && export PATH} @end example @end cartouche -シェルの初期設定ファイルに上記のコマンドを追加すれば、今後ログインした後は自動的にどのディレクトリーでも @command{casl2}、@command{comet2}、@command{dumpword}を実行できるようになります。BASHの場合はホームディレクトリーにある@file{.bashrc}が初期設定ファイルのため、コマンドは次のようになります。 +シェルの初期設定ファイルに上記のコマンドを追加すれば、今後ログインした後は自動的にどのディレクトリーでも @command{casl2}、@command{comet2}、@command{dumpword}を実行できます。BASHではホームディレクトリーにある@file{.bashrc}が初期設定ファイルのため、次のコマンドで追加されます。 @cartouche @example -$ @b{echo ’PATH=$PATH:~/yacasl2 && export PATH’ >>~/.bashrc} +$ @command{echo ’PATH=$PATH:~/yacasl2 && export PATH’ >>~/.bashrc} @end example @end cartouche -@node tutorial,, install, Top +@node YACASL2の使い方,, YACASL2のインストール, Top @chapter YACASL2 の使い方 - YACASL2 は、テキストファイルに記述されたCASLプログラムを処理します。以下の例で用いられるCASLプログラムのファイルは、テキストエディタなどで作成してください。また、インストールしたディレクトリーの中にある@file{as}ディレクトリーからコピーして作成することもできます。 @section 実行結果の出力だけを表示 @@ -244,7 +249,7 @@ YACASL2 は、テキストファイルに記述されたCASLプログラムを @cartouche @example -$ @b{cat hello.casl} +$ @command{cat hello.casl} MAIN START OUT OBUF,LEN RET @@ -258,7 +263,7 @@ LEN DC 13 @cartouche @example -$ @b{casl2 hello.casl} +$ @command{casl2 hello.casl} Hello, World! @end example @end cartouche @@ -267,7 +272,7 @@ Hello, World! @cartouche @example -$ @b{cat addl.casl} +$ @command{cat addl.casl} ;;; ADDL r,adr MAIN START LD GR1,A @@ -283,7 +288,7 @@ B DC 1 @cartouche @example -$ @b{casl2 addl.casl} +$ @command{casl2 addl.casl} $ @end example @end cartouche @@ -294,7 +299,7 @@ $ @cartouche @example -$ @b{cat sum_10.casl} +$ @command{cat sum_10.casl} ;;; sum_10.casl ;;; 出力 GR0: 1から10までの整数をすべて加算した値 MAIN START @@ -318,7 +323,7 @@ STEP DC 1 ; 公差 このプログラムも、オプションなしで実行した場合には結果が出力されません。 @cartouche @example -$ @b{casl2 sum_10.casl} +$ @command{casl2 sum_10.casl} $ @end example @end cartouche @@ -330,7 +335,7 @@ casl2の処理途中で行われるアセンブルの結果を表示するには @cartouche @example -$ @b{casl2 -a -l hello.casl} +$ @command{casl2 -a -l hello.casl} Assemble hello.casl (0) @@ -389,7 +394,7 @@ Hello, World! @cartouche @example -$ @b{casl2 -a -l addl.casl} +$ @command{casl2 -a -l addl.casl} Assemble addl.casl (0) @@ -428,7 +433,7 @@ YACASL2では実行中のCPUのレジスターとメモリーの内容をそれ @cartouche @example -$ @b{casl2 -t -d -M8 addl.casl | less} +$ @command{casl2 -t -d -M8 addl.casl | less} Assemble addl.casl (0) @@ -489,7 +494,7 @@ Executing machine codes @cartouche @example -$ @b{casl2 -t addl.casl | grep 'GR1:'} +$ @command{casl2 -t addl.casl | grep 'GR1:'} #0000: GR1: 0 = #0000 = 0000000000000000 #0002: GR1: 3 = #0003 = 0000000000000011 #0004: GR1: 4 = #0004 = 0000000000000100 @@ -517,14 +522,14 @@ $ @b{casl2 -t addl.casl | grep 'GR1:'} @cartouche @example -$ @b{casl2 -t addl.casl | grep 'GR1:' | tail -1} +$ @command{casl2 -t addl.casl | grep 'GR1:' | tail -1} #0004: GR1: 4 = #0004 = 0000000000000100 @end example @end cartouche @cartouche @example -$ @b{casl2 -t sum_10.casl | grep 'GR0:' | tail -1} +$ @command{casl2 -t sum_10.casl | grep 'GR0:' | tail -1} #0010: GR0: 55 = #0037 = 0000000000110111 = '7' @end example @end cartouche @@ -535,14 +540,14 @@ $ @b{casl2 -t sum_10.casl | grep 'GR0:' | tail -1} @cartouche @example -$ @b{casl2 -t hello.casl | grep 'GR1:' | wc -l} +$ @command{casl2 -t hello.casl | grep 'GR1:' | wc -l} 11 @end example @end cartouche @cartouche @example -$ @b{casl2 -t addl.casl | grep 'GR1:' | wc -l} +$ @command{casl2 -t addl.casl | grep 'GR1:' | wc -l} 3 @end example @end cartouche @@ -551,18 +556,18 @@ $ @b{casl2 -t addl.casl | grep 'GR1:' | wc -l} @cartouche @example -$ @b{casl2 -t sum_10.casl | grep 'GR0:' | wc -l} +$ @command{casl2 -t sum_10.casl | grep 'GR0:' | wc -l} 54 @end example @end cartouche @section アセンブルと実行を別に行う -@command{casl2}に@option{-O}<@file{ファイル名}>を指定すると、オブジェクトファイルを作成できます。 +@command{casl2}に@option{-O}@file{ファイル名}を指定すると、オブジェクトファイルを作成できます。 @cartouche @example -$ @b{casl2 -Ohello.o hello.casl} +$ @command{casl2 -Ohello.o hello.casl} @end example @end cartouche @@ -570,7 +575,7 @@ $ @b{casl2 -Ohello.o hello.casl} @cartouche @example -$ @b{od -t x2 hello.o} +$ @command{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 @@ -584,19 +589,19 @@ $ @b{od -t x2 hello.o} @cartouche @example -$ @b{comet2 hello.o} +$ @command{comet2 hello.o} Hello, World! @end example @end cartouche @section 1語を解析する -CASL2では、1語(16ビット)を単位としてデータが処理されます。 +CASL IIでは、1語(16ビット)を単位としてデータが処理されます。 @command{dumpword}は、指定した1語を10進数、16進数、2進数で表示します。 @cartouche @example -$ @b{dumpword 72} +$ @command{dumpword 72} 72: 72 = #0048 = 0000000001001000 = 'H' @end example @end cartouche @@ -605,7 +610,7 @@ $ @b{dumpword 72} @cartouche @example -$ @b{dumpword -- -72} +$ @command{dumpword} @verb{|--|} @command{-72} -72: -72 = #FFB8 = 1111111110111000 @end example @end cartouche @@ -614,7 +619,7 @@ $ @b{dumpword -- -72} @cartouche @example -$ @b{dumpword '#0048'} +$ @command{dumpword '#0048'} #0048: 72 = #0048 = 0000000001001000 = 'H' @end example @end cartouche