<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2010-2023 j8takagi -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Assemble result (YACASL2 - CASL II 処理システム)</title>
<meta name="description" content="Assemble result (YACASL2 - CASL II 処理システム)">
<meta name="keywords" content="Assemble result (YACASL2 - CASL II 処理システム)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Sample-usage.html" rel="up" title="Sample usage">
<link href="Register-and-memory.html" rel="next" title="Register and memory">
<link href="Simple-output.html" rel="prev" title="Simple output">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body lang="ja_JP">
<span id="Assemble-result"></span><div class="header">
<p>
Next: <a href="Register-and-memory.html" accesskey="n" rel="next">Register and memory</a>, Previous: <a href="Simple-output.html" accesskey="p" rel="prev">Simple output</a>, Up: <a href="Sample-usage.html" accesskey="u" rel="up">Sample usage</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
<span id="asenburuJie-Guo-noQue-Ren-"></span><h3 class="section">2.2 アセンブル結果の確認</h3>
<p>casl2の処理途中で行われるアセンブルの結果を表示するには、オプション<samp>-a</samp>を指定します。
また、ラベルとアドレスの対応表を表示するには、オプション<samp>-l</samp>を指定します。
</p>
<p>次のコマンドでは<samp>hello.casl</samp>の、ラベルとアドレスの対応表と、アセンブル結果と、実行結果が表示されます。
OUTはアセンブラ命令で複数の機械語命令で構成されているため、命令行1行に対して、複数行のコードが生成されます。
</p>
<div class="example">
<pre class="example">$ <kbd>casl2 -a -l hello.casl</kbd>
Assemble hello.casl (0)
Label::::
MAIN.LEN ---> #0020
MAIN ---> #0000
MAIN.OBUF ---> #0013
Assemble hello.casl (1)
hello.casl: 1:MAIN START
hello.casl: 2: OUT OBUF,LEN
#0000 #7001
#0001 #0000
#0002 #7002
#0003 #0000
#0004 #1210
#0005 #0013
#0006 #1220
#0007 #0020
#0008 #F000
#0009 #0002
#000A #1210
#000B #0021
#0021 #000A
#000C #1220
#000D #0022
#0022 #0001
#000E #F000
#000F #0002
#0010 #7120
#0011 #7110
hello.casl: 3: RET
#0012 #8100
hello.casl: 4:OBUF DC 'Hello, World!'
#0013 #0048
#0014 #0065
#0015 #006C
#0016 #006C
#0017 #006F
#0018 #002C
#0019 #0020
#001A #0057
#001B #006F
#001C #0072
#001D #006C
#001E #0064
#001F #0021
hello.casl: 5:LEN DC 13
#0020 #000D
hello.casl: 6: END
Hello, World!
</pre></div>
<p><samp>addl.casl</samp>の、ラベルとアドレスの対応表と、アセンブル結果は、次のようになります。
</p>
<div class="example">
<pre class="example">$ <kbd>casl2 -a -l addl.casl</kbd>
Assemble addl.casl (0)
Label::::
MAIN ---> #0000
MAIN.A ---> #0007
MAIN.B ---> #0008
MAIN.C ---> #0009
Assemble addl.casl (1)
addl.casl: 1:;;; ADDL r,adr
addl.casl: 2:MAIN START
addl.casl: 3: LD GR1,A
#0000 #1010
#0001 #0007
addl.casl: 4: ADDL GR1,B
#0002 #2210
#0003 #0008
addl.casl: 5: ST GR1,C
#0004 #1110
#0005 #0009
addl.casl: 6: RET
#0006 #8100
addl.casl: 7:A DC 3
#0007 #0003
addl.casl: 8:B DC 2
#0008 #0002
addl.casl: 9:C DS 1
#0009 #0000
addl.casl: 10: END
</pre></div>
<p>なお、オプション<samp>-A</samp>を指定すると、アセンブル結果が表示される時点で処理が終了します。
仮想マシンCOMET IIでのプログラム実行はされません。
</p>
</body>
</html>