
<hr><h3><A name="23">alu-instructions</A> ( r-dest r-op1 op2{r-op2|imm} --  )</h3>
<br>
Available instructions with this syntax: 
<p>
<strong>and eor sub rsb add adc sbc rsc tst teq cmp cmn orr bic </strong> 
<p>
These instructions all have two data-inputs to the alu, the register r-op1 and 
the operand op2.  This can be another register or an 8-bit immediate.  
<p>
The register r-op2 can be "shifted" in any way specified by a shift specifier, 
either a 5-bit integer or another register plus the shifted register.  The 
immediate operand can be rotated right by 2*(4-bit-integer).  
<p>
If you give "large" literals as arguments, the assembler will generate the 
correct shifts itself.  
<p>
The <strong>#</strong> modifier declares an immediate operand as in: \ top r0 3 
# add 
<p>
The <strong>s</strong> modifier will set the flags according to the result, the 
instruction will be <strong>adds</strong> instead of <strong>add</strong> .  

<hr><h3><A name="53">rr0</A> ( -- n )</h3>
 Extra: bug
<br>
n is the value contained in the saved copy of register r0.   <code><A href="_smal_BL#53"> rr0 </A></code> 
may be modified with the  <code><A href="_smal_BQ#2f8"> to </A></code> command.  
Other data register names are  <code><A href="_smal_BL#53"> rr0 </A>,</code>  <code><A href="_smal_BN#55"> rsp </A></code> 
etc.  

See:  <code><A href="_smal_BQ#2f8"> to </A></code>  <code><A href="_smal_AX#47"> .registers </A></code> 

<hr><h3><A name="83">#tib</A> ( -- addr )</h3>
 Extra: 83Std
<br>
The address of a  <code><A href="_smal_BK#322"> user </A></code> variable 
containing the number of bytes in the text input buffer.   <code><A href="_smal_BL#83"> #tib </A></code> 
is accessed by  <code><A href="_smal_AG#336"> word </A></code> when input is 
coming from the keyboard.  {0..capacity of TIB} 

See:  <code><A href="_smal_BM#2f4"> tib </A></code> "input stream" 

<hr><h3><A name="b3">(newexpect</A> ( addr +n -- )</h3>
<br>
The implementation of  <code><A href="_smal_AQ#1f0"> expect </A></code> enabled 
by LINEEDIT.  Receives a line of characters from the keyboard and stores them 
into memory, performing line editing as the characters are typed.  The transfer 
begins at addr proceeding towards higher addresses one byte per character until 
either a "return" is received or until +n characters have been transferred.  No 
more than +n characters will be stored.  The "return" is not stored into memory.  
No characters are received or transferred if +n is zero.  All characters 
actually received and stored into memory will be displayed, with the "return" 
displaying as a space (see note).  

See:  <code><A href="_smal_AO#2de"> span </A></code>  <code><A href="_smal_AQ#1f0"> expect </A></code> 
<p>
This word provides quite powerful Emacs-style line editing, with the ability to 
add, delete, or change characters anywhere in the line being typed.  It has a 
history mechanism which allows the user to retrieve and edit a number of 
previously-typed lines, and a command completion feature which can be used to 
reduce the amount of typing necessary.  
<p>
The Forth 83 Standard specifies that the "return" character is displayed as a 
space, but Risc-OS Forthmacs displays it as a "return".   <code><A href="_smal_AO#21e"> hidden </A>.</code> 

<hr><h3><A name="e3">.pointers</A> ( --  )</h3>
<br>
Searches the whole Risc-OS Forthmacs system and looks for relocated pointers 
pointing outside the Risc-OS Forthmacs area, non-relocated data inside 
Risc-OS Forthmacs and displays the values and names.  
<p>
This might be useful when debugging code relying on such pointers.  

<hr><h3><A name="113">:</A> ( -- sys )</h3> <kbd>name</kbd> 
 Extra: M,ANS,83Std
<br>
A defining word used in the form: 
<br><code>    : &lt;name&gt; ...  ;</code><br>
Create a word definition for &lt;name&gt; in the compilation vocabulary  <code><A href="_smal_BL#1a3"> current </A></code> 
and set compilation state.  The compilation vocabulary is unchanged.  The text 
from the input stream is subsequently compiled.  &lt;name&gt; is called a "colon 
definition".  The newly created word definition for &lt;name&gt; cannot be found 
in the dictionary until the corresponding ; or  <code><A href="_smal_BN#115"> ;code </A></code> 
is successfully processed.  
<p>
An error condition exists if a word is not found and cannot be converted to a 
number or if, during compilation from mass storage, the input stream is 
exhausted before encountering ; or  <code><A href="_smal_BN#115"> ;code </A>.</code> 
sys is balanced with its corresponding ;.  
<p>
Implementation Note: The error condition described above actually results in the 
word  <code><A href="_smal_BD#25b"> lose </A></code> being compiled into the 
dictionary, and compilation continues after an error message is printed.  The 
word  <code><A href="_smal_BD#25b"> lose </A>,</code> if executed, will print an 
error message and  <code><A href="_smal_BJ#141"> abort </A>.</code> 
<p>
Implementation Note: In former Risc-OS Forthmacs systems the search order was 
changed so that the first vocabulary in the search order was replaced by the 
compilation vocabulary.  This was done so as in all Forth-83 systems.  

<hr><h3><A name="143">abs</A> ( n -- u )</h3>
 Extra: 83Std
<br>
u is the absolute value of n.  If n is the maximum negative number, u is the 
same value (since the maximum negative number in two's complement notation has 
no positive equivalent).  

<hr><h3><A name="173">canonical</A> ( pstr -- pstr )</h3>
<br>
pstr is the address of a packed string.  That string is converted to "canonical 
form", the form in which names are stored in the dictionary.  If  <code><A href="_smal_BM#174"> caps </A></code> 
contains zero, no action is taken.  If  <code><A href="_smal_BM#174"> caps </A></code> 
contains nonzero, the dictionary is assumed to be all of a single case, and the 
string at pstr is converted to that case.  In this implementation, the 
"canonical form" is lower case.  See  <code><A href="_smal_BM#174"> caps </A>.</code> 

<hr><h3><A name="1a3">current</A> ( -- addr )</h3>
 Extra: 83Std
<br>
The address of a  <code><A href="_smal_BK#322"> user </A></code> variable 
specifying the vocabulary in which new word definitions are appended.  

<hr><h3><A name="1d3">du</A> ( addr -- addr+64 )</h3>
<br>
Like dump, but assumes a length of 64.  Also leaves the next address after the 
dump on the stack, so successive DU's will scan through memory.  

<hr><h3><A name="203">flip</A> ( w1 -- w2 )</h3>
<br>
w2 is the result of exchanging the bytes in the lower 16 bits of the number w1.  

<hr><h3><A name="233">interpret-do-literal</A> ( n -- n  )</h3>
 Extra: Interpreting
<br>
 <code><A href="_smal_BL#233"> interpret-do-literal </A></code> is an 
implementation of the deferred word  <code><A href="_smal_AX#1c7"> do-literal </A>.</code>  <code><A href="_smal_AX#1c7"> do-literal </A></code> 
is executed from  <code><A href="_smal_AR#71"> "compile </A></code> if the word 
under consideration is a number.  n is the value of that number.  
<p>
 <code><A href="_smal_BL#233"> interpret-do-literal </A></code> is used while 
interpreting.  While compiling,  <code><A href="_smal_AR#191"> compile-do-literal </A></code> 
is used instead.   <code><A href="_smal_BL#233"> interpret-do-literal </A></code> 
leaves the number on the stack, which in this implementation means that it 
doesn't really do anything.  
<p>

See:  <code><A href="_smal_AX#1c7"> do-literal </A></code>  <code><A href="_smal_AR#191"> compile-do-literal </A></code> 
"Text Interpreter" 

<hr><h3><A name="263">m*/</A> ( d1 n1 2 -- d2  )</h3>
<br>
Multiply d1 by n1 producing the triple-cell intermediate result t.  Divide t by 
+n2 giving the double-cell quotient d2.  

<hr><h3><A name="293">pad</A> ( --  addr )</h3>
 Extra: 83Std
<br>
The lower address of a scratch area used to hold data for intermediate 
processing.  The address or contents of  <code><A href="_smal_BL#293"> pad </A></code> 
may change and the data lost if the address of the next available dictionary 
location is changed.  The minimum capacity of  <code><A href="_smal_BL#293"> pad </A></code> 
is 84 characters.  

<hr><h3><A name="2c3">save-string</A> ( pstr1 -- pstr2 )</h3>
<br>
The packed string at pstr1 is moved to a different place, and the address of 
that different place is returned as pstr2.  This may be used to save a string 
returned by  <code><A href="_smal_AS#162"> bl </A></code>  <code><A href="_smal_AG#336"> word </A></code> 
or  <code><A href="_smal_AN#6d"> "" </A></code> so that another string may be 
immediately collected.  Only one level of temporary string storage is provided.  

<hr><h3><A name="2f3">then</A> ( -- )</h3>
 Extra: compiling
<br>
 ( sys -- )<br>
<br>
Used in the form: 
<p>
<br><code>    if  ...  else  ...  then</code><br>
<br><code>      or</code><br>
<br><code>    if  ...  then</code><br>
<p>
 <code><A href="_smal_BL#2f3"> then </A></code> is the point where execution 
continues after  <code><A href="_smal_BR#1d9"> else </A></code> , or  <code><A href="_smal_AT#223"> if </A></code> 
when no  <code><A href="_smal_BR#1d9"> else </A></code> is present.  sys is 
balanced with its corresponding  <code><A href="_smal_AT#223"> if </A></code> or  <code><A href="_smal_BR#1d9"> else </A></code> 
.  

See:  <code><A href="_smal_AT#223"> if </A></code>  <code><A href="_smal_BR#1d9"> else </A></code> 

<hr><h3><A name="323">user-size</A> ( -- n )</h3>
 Extra: M
<br>
The size in bytes of the  <code><A href="_smal_BK#322"> user </A></code> area.  
This is not the same as  <code><A href="_smal_BN#85"> #user </A></code> , which 
contains the first unallocated  <code><A href="_smal_BK#322"> user </A></code> 
area location.  
