annotate TL1/tl1.html @ 178:4d83154d2a78

add - {} some builtin in TL/1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 15 Apr 2019 09:43:28 +0900
parents ce695e5e38d8
children 63de06ad7a49
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <html xmlns='http://www.w3.org/1999/xhtml'>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 <head>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
4 <title>TL/1 language specification</title>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 <link rel='stylesheet' type='text/css' href='tl1.css' />
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 </head>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 <body>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
8 <h1>TL/1 language specification</h1>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
9 <h2>Introduction</h2>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
10 <p>TL/1 is a pascal like one pass compiler for 8bit cpu, which is implented by Hiroshi Ohnishi in 1980.
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
11 It has very fast compilation speed, but only supports 8bit variable and array. 16bit addressed memory can be accessed by MEM variable.
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
12
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
13 <h2> example TL/1 source </h2>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
14
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
15 <a href="test/t1.tl1"> t1.tl1 </a>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
16 <pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
17 % TEST PROGRAM **
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
18 PROC WAIT,TIME
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
19 %--- MAIN ---
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
20 VAR I
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
21 BEGIN
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
22 WRITE(1:"Do ")
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
23 FOR I:=1 TO 10 DO [
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
24 WRITE(1:I,CRLF)
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
25 TIME
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
26 ]
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
27 WAIT
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
28 END
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
29 %-- PROCEDURE WAIT --
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
30 WAIT
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
31 VAR I,J,K
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
32 BEGIN
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
33 FOR I:=0 TO 1 DO [
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
34 FOR J:=0 TO 255 DO [
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
35 FOR K:=0 TO 255 DO []]]
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
36 END
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
37 %-- PROCEDURE TIME --
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
38 TIME
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
39 VAR I,J
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
40 BEGIN
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
41 FOR I:=0 TO 10 DO [
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
42 FOR J:=0 TO 150 DO []]
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
43 END
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
44 </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
45
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
46 <a href="test/t2.tl1"> t2.tl1 </a>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
47
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
48 <a href="test/t3.tl1"> t3.tl1 </a>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
49
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
50 <p>This document is a summary of the language specification of the programming language TL/1. Based on the explanation in magazines and the web etc., it is what I reorganized into the format of the specification with the addition of my interpretation and the indication of ambiguous parts.</p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
51 <p>We may use terms that are not in the original document for the purpose of explanation.</p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
52 <p>The places in this text that are referred to as "undefined" are explicit indications that the original source material can not be judged.</p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
53 <p>Although <a href="tl1-syntax-diagram.xhtml">syntax diagrams </a> are prepared, it is better to read the sentences first and then refer to the syntax diagrams because there is a unique part in the interpretation of identifiers.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
54 </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
56 <h2>Token</h2>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
58 <h3>Comment</h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
59 <p>The percent sign (%) to the next newline is ignored, and it is treated as whitespace. Use it to describe the program description etc.</p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
61 <h3 id='identifier'>Identifier</h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
62 <p>It consists of zero or more alphanumeric characters, beginning with an alphabetic character. The word continues up to just before a character (space or symbol) that does not form an identifier. Uppercase and lowercase letters are not distinguished.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
63   There is no upper limit on the identifier length.</p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
64 <p>Reserved words, procedure names, function names, global single variable names, global array names, small area single variables, and small area array names may have the same spelling. It is not checked at the time of declaration if it is identical to the existing name. Except where in the declaration, the implementation tries the name search in the following order and interprets it as the identifier of the first attribute found.</p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 <ol>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
66 <li> Local array name </li>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
67 <li> Local single variable name </li>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
68 <li> Global array name </li>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
69 <li> Global single variable name </li>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
70 <li> function name </li>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
71 <li> Procedure name </li>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
72 <li> reserved words </li>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 </ol>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
75 <h3 id='number'>Number</h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
76 <p> There are 4 types of expressions. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
77 <p> The numbers that can be handled directly with TL/1 are byte sizes, so the numeric representations that appear in a program are always in the range of 0-255. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
78 <p> In places where a boolean value is required in the syntax, 255 is interpreted as true, and other values are interpreted as false. A function that returns a boolean value returns 255 as true and 0 as false. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
80 <h4> decimal constant </h4>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
81 <p> One or more of the characters 0-9 can be numbers in the range 0-255. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
82 <p> Behavior is not defined if you add an extra 0 at the beginning (such as 02). </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
84 <h4> Hexadecimal constant </h4>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
85 <p> Symbols beginning '$' which follows 0 to 9 or a to f represent 0 to 255 in hexadecimal notation. The letters a to f have the same meaning even if they use uppercase letters (A to F). </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
86 <p> Do not put a space character after the symbol $. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
87 <p> It is permissible to add an extra 0 (for example $0A) to make two digits in hexadecimal, but if you add more 0 (for example $002) The behavior of) is undefined. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
89 <h4> Character literal constant </h4>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
90 <p> Expressed by a single character between quotes. It is considered that the same numerical value as the one-letter ASCII code is written. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
91 <pre class = 'example'> 'A' has the same meaning as 65.</pre>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
93 <h4> Logical constant </h4>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
94 <p> represented by <span class = 'reserved'> TRUE </span> or <span class = 'reserved'> FALSE </span>. <span class = 'reserved'> TRUE </span> is equivalent to $FF and <span class = 'reserved'> FALSE </span> is equal to 0. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
96 <h3> symbol </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
97 <p> Others, symbols are used for operators and syntax, but they will be covered in the syntax description below. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
99 <h3> Space character </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
100 <p> It can be inserted between words. One word is sufficient for word separation, but the meaning does not change even if it continues several times. Please use it to adjust the appearance. The following characters are interpreted as whitespace characters. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 <ul>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
102 <li> Character code less than $1F (control character) </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
103 <li> Blank </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
104 <li> Period (.) </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
105 <li> Semicolon (;) </li>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 </ul>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
107 <p> There are also habitual meanings to how to use, which will be described later. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
109 <h2> Program configuration </h2>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
110 <p> Programs are organized in the following order. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 <ol>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
113    <li> Procedure name declaration </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
114    <li> Function name declaration </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
115    <li> Global single variable name declaration </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
116    <li> Global array name / array size declaration </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
117    <li> Main program definition </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
118    <li> Procedure or function definition group </li>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 </ol>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
121 <p> The contents of each are as follows. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
123 <h3> Procedure Name Declaration </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
124 <p> Comma separated list of the procedure names to be used in the program following the reserved word <span class = 'reserved'> PROC </span>.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
125 </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
126 <pre class = 'form'>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
127 <span class = 'reserved'> PROC </span> <span class = 'metavar'> procedure 1 </span>, <span class = 'metavar'> procedure 2 </span>, <span class = 'metavar' > Procedure 3 </span> ...
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
128 </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
129 <p> The declaration can be ommited if there are zero procedures. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
131 <h3> Function name declaration </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
132 <p> Comma separated list of the function name to be used in the program following the reserved word <span class = 'reserved'> FUNC </span>.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
133 </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
134 <pre class = 'form'>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
135 <span class = 'reserved'> FUNC </span> <span class = 'metavar'> function 1 </span>, <span class = 'metavar'> function 2 </span>, <span class = 'metavar' > Function 3 </span> ...
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
136 </pre>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
137 <p>If the number of functions is zero, the declaration is omitted. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
139 <h3> Global scalar variable name declaration </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
140 <p> Comma separated list of scalar variable names used throughout the program following the reserved word <span class = 'reserved'> VAR </span>.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
141 </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
142 <pre class = 'form'>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
143 <span class = 'reserved'> VAR </span> <span class = 'metavar'> single variable 1 </span>, <span class = 'metavar'> single variable 2 </span>, <span class = ' metavar '> single variable 3 </span> ...
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
144 </pre>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
145 <p> The declaration can be ommited if there are zero global scalar variables. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
146 <p> The variables must be within 256 bytes in total with the global array described below.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
147 Furthermore, if you call <a href='#subprogram'> subprogram </a>, you need room for 2 bytes
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
148 (the sum of global single variable and global array needs to be less than 254 bytes) . </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
150 <h3> Global array name / array size declaration </h3>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
151 <p> Camma separated list of an array name and its size to be used throughout the program following the reserved word <span class = 'reserved'> ARRAY </span>.
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
152 The size of the array is indicated by the numerical value enclosed by square brackets after the array name. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
153 <pre class = 'form'>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
155 <span class='reserved'>ARRAY</span> <span class='metavar'>array1</span> [ <span class='metavar'>size of array1</span> ] ,
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
156 <span class='metavar'>array2</span> [ <span class='metavar'>size of array2</span> ] ,
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
157 <span class='metavar'>array3</span> [ <span class='metavar'>size of array3</span> ] ...
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 </pre>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
159
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
160 <p> The size of the array is the maximum value of array subscripts. For example, for arrays declared as A[10],
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
161 it means that they can be safely referenced with an index of 0-10. It is not the number of elements of the array such as C.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
162 </p>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
163 <h3> Main program definition </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
164 <p> 0 or more <a href='#statement'> statements </a> between <span class = 'reserved'> BEGIN </span> and <span class = 'reserved'> END </span> . </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
165
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
166 <h3 id = 'subprogram'> Subprogram definitions </h3>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
167 <p> A subprogram is a procedure or a function. It is organized in the following order: </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 <ol>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
169 <li> Sub-program name </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
170 <li> formal argument list </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
171 <li> Sub-area single variable name declaration </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
172 <li> Small-area array name / array size declaration </li>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
173 <li> Reserved words <span class = 'reserved'> BEGIN </span> </li>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
174 <li> 0 or more statements </li>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
175 <li> Reserved words <span class = 'reserved'> END </span> </li>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
176 </ol>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
177
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
178 <p> This is repeated by the number of subprograms. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
179 <p> The definition of a subprogram does not have to match the order of declaration. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
180
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
181 <h4> Sub program name </h4>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
182
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
183 <p> The name must be delcared in the procedure or the function name declaration part of the program. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
184
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
185 <h4> Formal argument list </h4>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
186 <p> Multiple identifiers enclosed in parentheses. Separate multiple identifiers with commas. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
187 <pre class = 'form'>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
188 (<span class = 'metavar'> argument 1 </span>, <span class = 'metavar'> argument 2 </span>, <span class = 'metavar'> argument 3 </span> .. .)
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
189 </pre>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
190 <p> Arguments are passed by values. These are local sacalar variables which are initialized with the actual argument at the time of invocation.
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
191 (Implicit local scalar variable declaration) </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
192 <p> If there are no arguments, you can omit the parentheses. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
193
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
194 <h4> Local scalar variable name declaration </h4>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
195 <p> Declare single variables that can be referenced only in the relevant subprogram. The format is the same as a global single variable. </p>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
196 <p> Omit the declaration if there are zero subregion single variables. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
197 <p> Similar to global single variables and global arrays, the combined size of the subregion single variables and the subregion array must be 256 bytes or less. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
198
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
199 <h4> Local array name declaration </h4>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
200 <p> Declare an array that can be referenced only in the subprogram. The format is the same as for a global array. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
201
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
202
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
203 <h2 id='statement'>statements</h2>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
204
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
205 <h3> compound statements </h3>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
206 <p> You can combine 0 or more statements with one or more statements into one statement. </p >
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
207 <pre class = 'form'> <span class = 'reserved'> BEGIN </span> <span class = 'metavar'> statement list </span> <span class = 'reserved'> END </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
208 <pre class = 'form'> {<span class = 'metavar'> statement list </span>} </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
209 <pre class = 'form'> [<span class = 'metavar'> statement list </span>] </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
210 <pre class = 'form'> (<span class = 'metavar'> statement list </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
211 <p> Compound sentences behave as if they were one statement,
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
212 so they can appear anywhere the statement can appear in the following explanation.
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
213 A compound statement with 0 enclosed execution statements is called a blank statement. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
214 <p> Any parenthesis means the same thing, but it must be closed with the corresponding closing parenthesis.
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
215 For example, it is not possible to start with "{" and close it with "]". </p>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
216 <p> It is customary to write a semicolon (;) which is ignored as a space character to separate each statement in a compound statement. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
217 <p> The main program and sub program text is also a kind of compound sentence, but as shown above, there must be in
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
218 <span class = 'reserved'> BEGIN </span> and <span class = 'reserved'> END </span>.
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
219 You can not use other parentheses. </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
220
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
221 <h3> STOP </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
222 <p> Stop the execution and jump to the monitor. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
223 <p> It is inserted automatically at the end of the main program, so it does not have to be written, but it can be written anywhere in the main program / subprogram. </p>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
224 <h3> RETURN </h3>
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
225 <p> Returns from a procedure or function. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 <pre class='form'>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 <span class='reserved'>RETURN</span>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 </pre>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 <pre class='form'>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
230 <span class='reserved'>RETURN</span> <span class='metavar'>expression</span>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 </pre>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
232
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
233 <p> When returning from a procedure, write in a format without an expression, and when returning from a function, write in a format followed by one expression. </p>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
234 <p> It is inserted automatically at the end of the procedure, so it does not have to be written, but it can be used anywhere in the procedure. (Do not use it in <span class = 'reserved'> FOR </span> loop in some implementations). </P>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
235 <p> At least one must be used in the function definition. (Note that it is not checked at compile time. Also,
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
236 should not be used in a <span class = 'reserved'> FOR </span> loop) </p>
173
7dd634f92ffd add tl1 english manual
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 131
diff changeset
237 The behavior when hit is undefined when it reached
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
238 to the end (<span class = 'reserved'> END </span>, which represents the end of the function definition)
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
239 without passing <span class = 'reserved'> RETURN </span> statement in a function </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
240
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
241 <h3> FOR </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
242 <p> Repeats statements while changing the value of a single variable. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
243 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
244 <span class = 'reserved'> FOR </span> <span class = 'metavar'> variable </span>: = <span class = 'metavar'> expression </span> <span class = 'reserved'> TO </span> <span class = 'metavar'> expression </span> <span class = 'reserved'> DO </span> <span class = 'metavar'> statements </span>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
246 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
247 <span class = 'reserved'> FOR </span> <span class = 'metavar'> variable </span>: = <span class = 'metavar'> expression 1 </span> <span class = 'reserved' > DOWNTO </span> <span class = 'metavar'> expression 2 </span> <span class = 'reserved'> DO </span> <span class = 'metavar'> statements </span> </pre> >
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
248 Assign the value of the expression to <span class = 'metavar'> the scalar variable </span> for <p> counting, and increment or decrease <span class = 'metavar'> scalar variable </span> by 1 at a time, repeat executing the statements. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
249 The increment of <p> <span class = 'metavar'> variable </span> is +1 when <span class = 'reserved'> TO </span> is used, <span class = 'reserved'> DOWNTO When using </span> it is -1. (<span class='reserved'> DOWNTO </span>can not use <span class = 'reserved'> DOWNTO </span> on some implementations.) </P>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
250
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
251 <h3> REPEAT </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
252 <pre class = 'form'> <span class = 'reserved'> REPEAT </span> <span class = 'metavar'> statement list </span> <span class = 'reserved'> UNTIL </span> <span class = 'metavar'> expression </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
253 <span class = 'metavar'> statement list </span> is repeated until the value of <p> <span class = 'metavar'> expression </span> becomes true. <span class = 'metavar'> statement list </span> is a sequence of zero or more execution statements. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
254
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
255 <h3> WHILE </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
256 <pre class = 'form'> <span class = 'reserved'> WHILE </span> <span class = 'metavar'> expression </span> <span class = 'reserved'> DO </span> <span class = 'metavar'> statement </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
257 If the value of <p> <span class = 'metavar'> expression </span> is false, it will move to the next processing without executing <span class = 'metavar'> statement </span>. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
258 <p> If the value of the expression is true, execute <span class = 'metavar'> execution statement </span> to return to the evaluation of <span class = 'metavar'> expression </span> again. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
259
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
260 <h3> IF </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
261 <pre class = 'form'> <span class = 'reserved'> IF </span> <span class = 'metavar'> expression </span> <span class = 'reserved'> THEN </span> <span class = 'metavar'> statement 1 </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
262 <pre class = 'form'> <span class = 'reserved'> IF </span> <span class = 'metavar'> expression </span> <span class = 'reserved'> THEN </span> <span class = 'metavar'> statement 1 </span> <span class = 'reserved'> ELSE </span> <span class = 'metavar'> statement 2 </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
263 If the value of <p> <span class = 'metavar'> expression </span> is true, <span class = 'metavar'> execute statement 1 </span> is executed. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
264 <p> <span class = 'metavar'> if the value of the expression </span> is false and the <span class = 'reserved'> ELSE </span> clause is not omitted <span class = 'metavar' Execute> statement 2 </span>. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
265 If the value of the <p> expression is false and the <span class = 'reserved'> ELSE </span> clause is omitted, the process proceeds to the next process without doing anything. (In some implementations, <span class = 'reserved'> ELSE </span> clause
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
266 Can not be used. ) </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
267
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
268 <h3> CASE </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
269 <pre class = 'form'>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
270
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
271 <span class = 'reserved'> CASE </span> <span class = 'metavar'> expression 0 </span> <span class = 'reserved'> OF </span>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
272      <span class = 'metavar'> expression 1 </span> <span class = 'metavar'> statement 1 </span>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
273      ...
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
274      <span class = 'metavar'> expression k-1 </span> <span class = 'metavar'> statement k-1 </span>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
275      <span class = 'reserved'> ELSE </span> <span class = 'metavar'> statement k </span>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
277 If the value of <p> <span class = 'metavar'> expression 0 </span> is compared with the value of <span class = 'metavar'> expression 1 </span> and it matches <span class = 'metavar' Execute> Execution statement 1 </span>. After that, it moves on to the next processing of <span class = 'metavar'> statement k </span>. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
278 <p> If it does not match, it compares with the expression one after another until it matches in the same way, and executes the execution statement corresponding to the matched expression. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
279 If there is a reserved word <span class = 'reserved'> ELSE </span> in the <p> part of the expression, it is regarded as unconditional and <span class = 'metavar'> statement k </Run span> </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
280 The <span class = 'reserved'> ELSE </span> clause in the <p> <span class = 'reserved'> CASE </span> statement is the end of the <span class = 'reserved'> CASE </span> statement There is also a marker indicating that it is a condition, so it can not be omitted. If there is no statement to be executed in the <span class = 'reserved'> ELSE </span> clause, write a blank statement. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
281
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
282 <h3> WRITE </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
283 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
284 <span class = 'reserved'> WRITE </span> (<span class = 'metavar'> expression </span>: <span class = 'metavar'> output list </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
286 Outputs the contents of the output list to the output device represented by the value of <p> expression. Although the correspondence between numbers and output devices is undefined, it is generally assumed that 0 is the console screen. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
287 <p> The output list consists of the following output elements, separated by commas if more than one. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
288 <h4> expression </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
289 <p> Write an expression. Output with decimal number left justified. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
290 <h4> right justified </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
291 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
292 # (<span class = 'metavar'> expression 1 </span>, <span class = 'metavar'> expression 2 </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
294 Outputs the value of <p> <span class = 'metavar'> expression 2 </span> with the number of digits of <span class = 'metavar'> expression 1 </span> with decimal right justification. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
295 <h4> string </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
296 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
297 &quot; <span class = 'metavar'> string </span> &quot;
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
299 <p> Output a string enclosed in double quotes. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
300 <h4> ASCII code </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
301 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
302 <span class = 'reserved'> ASCII </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
304 <p> <span class = 'metavar'> Outputs the character equivalent to the ASCII code given by the expression </span>. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
305
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
306 <h4> blank </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
307 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
308 <span class = 'reserved'> SPACE </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
310 <p> <span class = 'metavar'> Outputs the number of blanks given by the expression </span>. If the value of <span class = 'metavar'> expression </span> is 0, nothing is output. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
311 <h4> Line feed </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
312 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
313 <span class = 'reserved'> CRLF </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
315 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
316 <span class = 'reserved'> CRLF </span>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
318 <p> <span class = 'metavar'> Outputs the number of line breaks given by the expression </span>. If the value of <span class = 'metavar'> expression </span> is 0, nothing is output. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
319 <p> <span class = 'metavar'> expression </span> is omitted form 1 newline output. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
320 <h4> Hex </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
321 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
322 <span class = 'reserved'> HEX </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
324 <p> <span class = 'metavar'> output the value given by the expression </span> in 2 hexadecimal digits. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
325 <p> Not available on some implementations. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
326
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
327 <h3> Assignment </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
328 <pre class = 'form'> <span class = 'metavar'> variable </span>: = <span class = 'metavar'> expression </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
329 <pre class = 'form'> <span class = 'metavar'> variable 1 </span>, <span class = 'metavar'> variable 2 </span>, ..., <span class = 'metavar'> Variable k </span>: = <span class = 'metavar'> expression </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
330 Assign the value of <p> <span class = 'metavar'> expression </span> to <span class = 'metavar'> variable </span>. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
331 <p> If the variable is a comma separated list, assign the value of <span class = 'metavar'> expression </span> to all variables on the left side. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
332 <p> Because the assignment symbol consists of two words, colon and equal, even if there is a space character between colon and equal, it is recognized as an assignment symbol, but in general it writes without a space. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
333
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
334 <h3> Procedure call </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
335 <p> Call a procedure. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
336 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
337 <span class = 'metavar'> procedure name </span> (<span class = 'metavar'> expression </span>, <span class = 'metavar'> expression </span>, ... <span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
339 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
340 <span class = 'metavar'> procedure name </span>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
342 <p> A procedure with arguments is called with an actual argument. When calling a procedure that does not have an argument, you can call it with parentheses omitted, but it is an error if you write a procedure without an argument without omitting the parentheses. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
343 <pre class = 'example'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
344 FOO ()% such a call is an error
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
346 <p> Since the method of passing actual arguments is limited to so-called value passing, even if the actual argument is a variable, the value does not change when returning from the procedure. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
347
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
348 <h3> CALL </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
349 <p> Call a machine language subroutine. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
350 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
351 <span class = 'reserved'> CALL </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>, <span class = 'metavar'> A </span>, <span class = 'metavar'> H </span>, <span class = 'metavar'> L </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
353 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
354 <span class = 'reserved'> CALL </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>, <span class = 'metavar'> A </span>, <span class = 'metavar'> H </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
356 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
357 <span class = 'reserved'> CALL </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>, <span class = 'metavar'> A </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
359 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
360 <span class = 'reserved'> CALL </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
362 <p> Each parameter has the following meaning. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
364 <tr> <td> <span class = 'metavar'> AH </span> </td> <td> upper 8 bits of address </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
365 <tr> <td> <span class = 'metavar'> AL </span> </td> <td> lower 8 bits of address </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
366 <tr> <td> <span class = 'metavar'> A </span> </td> <td> value given to accumulator </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
367 <tr> <td> <span class = 'metavar'> H </span> </td> The value given to the H register in the 80th series CPU and the value given to the X register in the 6502 series CPU / tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
368 <tr> <td> <span class = 'metavar'> L </span> </td> Value given to L register in 80 series CPUs, Value given to Y register in 6502 series CPUs </td>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 </tr>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 </table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
371 <p> <span class = 'metavar'> A </span>, <span class = 'metavar'> H </span>, <span class = 'metavar'> L </span> may be abbreviated However, if omitted, each value will be undefined. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
372 <p> This procedure can not be used on some implementations. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
373
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
374 <h3> SENSE </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
375 <p> The PC detects whether the STOP key has been pressed, and APPLE has detected whether the cont-C has been pressed. If the key has been pressed, it returns to the monitor mode. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
376
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
377 <h2> Variables </h2>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
378 <p> Variables are all 1 byte long. There are 4 types below. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
379 <h3> Single variable </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
380 <p> <span class = 'reserved'> VAR </span> An alphanumeric string that begins with a declared letter. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
381 <p> There is a distinction between global and small areas. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
382
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
383 <h3> Array variable </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
384 <pre class = 'form'> <span class = 'metavar'> array variable name </span> [<span class = 'metavar'> expression </span>] </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
385 <p> <span class = 'reserved'> ARRAY </span> The <span class = 'metavar'> expression </span> 's element of a declared array. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
386 <p> There is a distinction between global and small areas. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
387
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
388 <h3> MEM variable </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
389 <pre class = 'form'> <span class = 'reserved'> MEM </span> (<span class = 'metavar'> formula 1 </span>, <span class = 'metavar'> formula 2 </span >) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
390 <p> <span class = 'metavar'> 1 byte in memory with the value of <span class = 'metavar'> expression 2 </span> as the lower address. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
391
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
392 <h3> PORT </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
393 <pre class = 'form'> <span class = 'reserved'> PORT </span> (<span class = 'metavar'> expression </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
394 <p> PC version only. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
395 <p> Corresponds to INP and OUT of N-BASIC. If it is on the left side of the assignment statement, it acts the same as OUT. If it is on the right side, it acts the same as INP. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
396
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
397 <h2> expression </h2>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
398 <h3> Constant </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
399 Represents a constant in one of the four formats shown in <p> <a href='#number'> Numbers </a>. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
400 <h3> Function call </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
401 <pre class = 'form'> <span class = 'metavar'> function name </span> (<span class = 'metavar'> formula 1 </span>, <span class = 'metavar'> formula 2 </span>, ..., <span class = 'metavar'> expression k </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
402 <pre class = 'form'> <span class = 'metavar'> function name </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
403 <p> <span class = 'reserved'> Calls a function declared by a <span> declaration or a system function (described later) provided by the processing system. When calling a function without arguments only the function name
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
404 You can call It is an error if you try to call a function without arguments in parenthesized form. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
405 <pre class = 'example'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
406 FOO: = BAR ()% Such a call is an error
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
408 <h4> MHIGH </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
409 <p> The result of multiplication by 1 byte can be 2 bytes, but only the lower 1 byte is represented in the expression. The upper one byte is stored in a dedicated location, and can be fetched with the <span class = 'reserved'> MHIGH </span> function. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
410 <h4> MOD </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
411 <p> The division returns the quotient, but at the same time the remainder is calculated and stored in a dedicated location, and can be retrieved using the <span class = 'reserved'> MOD </span> function. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
412 <h4> RND </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
413 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
414 <span class = 'reserved'> RND </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
416 <p> 1 or more <span class = 'metavar'> expression </span> Returns a uniform random number below. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
417
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
418 <h4> GET </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
419 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
420 <span class = 'reserved'> GET </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
422 <p> <span class = 'metavar'> Enters one character from the input device represented by the expression </span> and returns the value of its ASCII code. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
423 <p> The correspondence between numbers and input devices is undefined, but in general 0 seems to be a keyboard. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
424 <h4> READ </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
425 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
426 <span class = 'reserved'> READ </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
428 <p> <span class = 'metavar'> Enter a decimal number from the input device that corresponds to the value of the expression </span> and return that value. The RUBOUT code is considered as a delimiter. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
429 <h4> NOT </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
430 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
431 <span class = 'reserved'> NOT </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
432 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
433 <p> Returns 1's complement. Same as COM below. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
434 <h4> NEG </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
435 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
436 <span class = 'reserved'> NEG </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
438 <p> Returns 2's complement. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
439 <h4> COM </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
440 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
441 <span class = 'reserved'> COM </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
443 <p> Returns 1's complement. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
444
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
445 <h4> LSR </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
446 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
447 <span class = 'reserved'> LSR </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
449 <p> Shift right by 1 bit. The most significant bit contains 0 and the least significant bit enters the carry. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
450 <h4> ASR </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
451 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
452 <span class = 'reserved'> ASR </span> (<span class = 'metavar'> expression </span>)
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
453 </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
454 <p> Shift right by 1 bit. The most significant bit does not change and the least significant bit goes into carry. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
455 <h4> ASL </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
456 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
457 <span class = 'reserved'> ASL </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
459 <p> Shift left by 1 bit. The least significant bit contains 0 and the most significant bit enters the carry. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
460 <h4> ROR </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
461 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
462 <span class = 'reserved'> ROR </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
464 <p> Shift right by 1 bit. The carry is in the most significant bit and the least significant bit is in the carry. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
465 <h4> ROL </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
466 <pre class = 'form'>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
467 <span class = 'reserved'> ROL </span> (<span class = 'metavar'> expression </span>)
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 </pre>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
469 <p> Shift left by 1 bit. The carry is in the least significant bit and the most significant bit is in the carry. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
470
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
471 <h4> USR </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
472 <pre class = 'form'> <span class = 'reserved'> USR </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>, <span class = 'metavar'> A </span>, <span class = 'metavar'> AH </span>, <span class = 'metavar'> L </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
473 <pre class = 'form'> <span class = 'reserved'> USR </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>, <span class = 'metavar'> A </span>, <span class = 'metavar'> AH </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
474 <pre class = 'form'> <span class = 'reserved'> USR </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>, <span class = 'metavar'> A </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
475 <pre class = 'form'> <span class = 'reserved'> USR </span> (<span class = 'metavar'> AH </span>, <span class = 'metavar'> AL </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
476 <p> The function is the same as the CALL statement, but the value of the accumulator after the execution of the machine language subroutine is returned as the return value. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
477 <p> It can not be used depending on the processing system. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
478 <h4> RDHEX </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
479 <pre class = 'form'> <span class = 'reserved'> RDHEX </span> (<span class = 'metavar'> expression </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
480 <p> Enter one hexadecimal digit from the input device. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
481 <p> It can not be used depending on the processing system. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
482 <h4> RRC </h4
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
483 > <pre class = 'form'> <span class = 'reserved'> RRC </span> (<span class = 'metavar'> expression </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
484 <p> Shifts the value of the expression one bit to the right without going through carry. The least significant bit is the most significant. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
485 <p> It can not be used depending on the processing system. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
486 <h4> RLC </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
487 <pre class = 'form'> <span class = 'reserved'> RLC </span> (<span class = 'metavar'> expression </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
488 <p> Shifts the value of the expression one bit to the left without going through carry. The most significant bit is in the least significant bit. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
489 <p> It can not be used depending on the processing system. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
490
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
491 <h3> Binary operator </h3>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
492 <p> This is an operator that calculates two terms on the left and right. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
493 <pre class = 'form'> <span class = 'metavar'> term 1 </span> <span class = 'metavar'> operator </span> <span class = 'metavar'> term 2 </span> </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
494 The precedence of <p> operators is as shown in the table. Operators with the same precedence are left coupled. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
496 <tr> <td> 1 </td> <td> multiplication and division operator </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
497 <tr> <td> 2 </td> <td> addition-subtraction operator </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
498 <tr> <td> 3 </td> <td> relational operators </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
499 <tr> <td> 4 </td> <td> logical operators </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
500 <tr> <td> 5 </td> <td> carry with addition / subtraction operator </td> </tr>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 </table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
502 <p> Use expression brackets if you want to change the priority. The following three types of parentheses can be used as expression brackets, but in the standard case we will use parentheses. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
503 <pre class = 'form'> {<span class = 'metavar'> expression </span>} </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
504 <pre class = 'form'> [<span class = 'metavar'> expression </span>] </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
505 <pre class = 'form'> (<span class = 'metavar'> expression </span>) </pre>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
506 It is customary to put periods on both sides that are interpreted as whitespace for the operator of the identifier rather than the <p> symbol. In my opinion, it is thought to be a device that makes it easier to distinguish from function calls. </p>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
507 <pre class = 'example'>. <span class = 'reserved'> AND </span>. </pre>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
508
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
509 <h4> Multiplication division operator </h4>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
511 <tr> <td> * </td> <td> multiplication </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
512 <tr> <td> / </td> <td> quotient of division </td> </tr>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 </table>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
514
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
515 <h4> Addition-subtraction operator </h4>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
516 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
517 <tr> <td> + </td> <td> addition </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
518 <tr> <td>-</td> <td> subtraction </td> </tr>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
519 </table>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
520
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
521 <h4> Relational operator </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
522 <p> Compares two values ​​and returns a boolean value. <span class = 'reserved'> GT </span> and <span class = 'reserved'> LT </span> compare and compare left and right numbers as signed binary numbers in 2's complement representation. Other operators interpret numbers as unsigned binary. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
524 <tr> <td> &gt; </td> <td> large </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
525 <tr> <td> &lt; </td> <td> small </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
526 <tr> <td> # </td> <td> not equal </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
527 <tr> <td> = </td> <td> equal </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
528 <tr> <td> <span class = 'reserved'> GT </span> </td> <td> large </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
529 <tr> <td> <span class = 'reserved'> LT </span> </td> <td> large </td> </tr>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 </table>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
531
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
532 <h4> Logical operator </h4>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
534 <tr> <td class = 'reserved'> AND </td> <td> logical product </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
535 <tr> <td class = 'reserved'> OR </td> <td> disjunction </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
536 <tr> <td class = 'reserved'> EOR </td> <td> exclusive OR </td> </tr>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 </table>
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
538
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
539 <h4> Carry with addition and subtraction operator </h4>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
540 <p> An operator that adds two terms and adds the carry value, or subtracts two terms and subtracts the carry value. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 <table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
542 <tr> <td class = 'reserved'> ADC </td> <td> Add with Carry </td> </tr>
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
543 <tr> <td class = 'reserved'> SBC </td> <td> subtraction with borrow </td> </tr>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 </table>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
545 <p> While it is specified that part of the system function changes the flag, it is undefined which process changes the flag. In general, addition and subtraction seem to change the flag, but depending on the processing system, it may be changed when accessing an array element. It is considered safe to use carry addition / subtraction only immediately after addition / subtraction. </p>
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 </body>
174
ce695e5e38d8 documents
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
547
131
188111be26b4 add document
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 </html>