📄 opt.html
字号:
<!doctype html public "-//W3C//DTD HTML 3.2//EN"><html><head><title>Assembler options</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><meta http-equiv="content-language" content="en" /><meta name="resource-type" content="document"><meta name="copyright" content="This document copyright 2001 by Richard Murray. Use for non-profit and education purposes explicitly granted."><meta name="author" content="Richard Murray"><meta name="rating" content="general"></head><!-- /assembler/opt.html --><!-- --><!-- (C) Copyright 2001 Richard Murray --><!-- Designed by Richard Murray --><!-- rmurray@heyrick.co.uk --><!-- --><body bgcolor="#f0f0f0" text="#000000" link="#0022dd" vlink="#002288"><table border = "0" width="100%"> <tr> <td align=center width=100> <img src="arm3.gif" width=79 height=78 align = middle> </td> <td> <h1 align="center"><font color="#800080">Assembler<br>options</font></h1> </td> <td align=center width=100> <img src="arm3.gif" width=79 height=78 align = middle> </td></table><p> <p><a name="opt"></a>The <code>OPT</code> keyword denotes how the following block of assembler should be handled. Itrelates to every block seperately, so you must put the <code>OPT</code> keyword at the start ofeach block. For example:<pre> FOR loop% = 0 TO 2 STEP 2 P% = code% [ OPT loop% ... some basic initialization stuff here ... ] IF computer_is_networked% THEN [ OPT loop% ... network code ... ] ELSE [ OPT loop% ... non-network code ... ] ENDIF [ OPT loop% ... the rest of the code ... ] NEXT</pre>This is a rough example showing how different bits of code can be utilised depending upon thecurrent conditions (and the code need not be the same number of instructions either!); and itshows how you must use the <code>OPT</code> keyword - even if you only have one loop. Howeverthe power and complexity of BASIC can be utilised to build up all kinds of fancy code.<p> <p> <p>The <code>OPT</code> parameters have the following meanings:<pre> Bit 0 - Produce a listing during the compilation Bit 1 - Report errors, such as unresolved references Bit 2 - Offset assembly, if code is compiled for execution at a different place to where it currently is. Bit 3 - Range check, will report if the code being compiled overshoots the memory allocated. Bit 4 - Enables the 'new' instructions. <a href="#newlist">A list of them is here</a>. Bit 8 - If set, the SWI "OS_SynchroniseCacheAreas" is not called after compilation. (does anybody know when this was introduced? RISC OS 3.7?) Option List Err Offs RChk -------------------------------- OPT 0 No No No No <-- First pass OPT 1 Yes No No No OPT 2 No Yes No No <-- Second pass OPT 3 Yes Yes No No OPT 4 No No Yes No OPT 5 Yes No Yes No OPT 6 No Yes Yes No OPT 7 Yes Yes Yes No OPT 8 No No No Yes <-- Alt. first pass OPT 9 Yes No No Yes OPT 10 No Yes No Yes <-- Alt. second pass OPT 11 Yes Yes No Yes OPT 12 No No Yes Yes OPT 13 Yes No Yes Yes OPT 14 No Yes Yes Yes OPT 15 Yes Yes Yes Yes OPT 16 No list, no error reporting, no offset assembly, no range check, but will use <a href="#newlist">new instructions</a>. ...through to... OPT 31 List, error reporting, offset assembly, range checking, and uses the <a href="#newlist">new instructions</a>. The first two option codes indicated are common values used when compiling code. The alternative option codes are identical, except that range checking is enabled. This is useful for reporting if the code is larger than the space allocated. To include new instructions in a program, instead of doing: FOR loop% = 0 TO 2 STEP 2 P% = code% [ OPT loop% You would do: FOR loop% = 16 TO 18 STEP 2 P% = code% [ OPT loop%</pre> <p> <p> <p><a name="newlist"></a><h2>New instructions</h2>The RISC OS 3.80 assembler allowed extended instructions, but this can cause problems in code(is "<code>BXR0</code>" a branch to label <i>XR0</i>, or is it a thumb instruction?).So RISC OS 4 now has this selectable with a bit in the options.<p>A lot of the functionality here is duplicated by Darren Salt's ExtBASasm module. To give you anexample, the instruction in <i>italics</i> is NOT supported by ExtBASasm (there's only one). Therest are...<p>Links take you to places where you can find out more about the linked instruction.<p>The new instructions are:<p><b>ARM7 / StrongARM extensions</b><ul> <li> UMULL, UMLAL, SMULL, SMLAL. <li> LDRSB, LDRH, LDRSH, STRSB, STRH, STRSH.</ul><b>Thumb</b><ul> <li> <i>BX</i> (but there's no support for other THUMB instructions).</ul><b>Co-processor</b><ul> <li> MRC, MCR. <li> CDP. <li> LDC, STC.</ul><b>32 bit</b><ul> <li> <a href="psr.html#32bit">MRS</a>, <a href="psr.html#32bit">MSR</a>.</ul><b>Floating point maths</b><ul> <li> <a href="fpops.html">ADF</a>, <a href="fpops.html">MUF</a>, <a href="fpops.html">SUF</a>, <a href="fpops.html">RSF</a>, <a href="fpops.html">DVF</a>, <a href="fpops.html">RDF</a>, <a href="fpops.html">POW</a>, <a href="fpops.html">RPW</a>, <a href="fpops.html">RMF</a>, <a href="fpops.html">FML</a>, <a href="fpops.html">FDV</a>, <a href="fpops.html">FRD</a>, <a href="fpops.html">POL</a>. <li> <a href="fpops.html">MVF</a>, <a href="fpops.html">MNF</a>, <a href="fpops.html">ABS</a>, <a href="fpops.html">RND</a>, <a href="fpops.html">SQT</a>, <a href="fpops.html">LOG</a>, <a href="fpops.html">LGN</a>, <a href="fpops.html">EXP</a>, <a href="fpops.html">SIN</a>, <a href="fpops.html">COS</a>, <a href="fpops.html">TAN</a>, <a href="fpops.html">ASN</a>, <a href="fpops.html">ACS</a>, <a href="fpops.html">ATN</a>, <a href="fpops.html">URD</a>, <a href="fpops.html">NRM</a>. <li> <a href="fpops.html">FLT</a>, <a href="fpops.html">FIX</a>. <li> <a href="fpops.html">WFS</a>, <a href="fpops.html">RFS</a>, <a href="fpops.html">WFC</a>, <a href="fpops.html">RFC</a>. <li> <a href="fpops.html">CMF</a>, <a href="fpops.html">CNF</a>. <li> <a href="fpops.html">LDF</a>, <a href="fpops.html">STF</a>. <li> <a href="fpops.html">LFM</a>, <a href="fpops.html">SFM</a>. <li> <a href="fpops.html">DCF</a>, EQUF.</ul><b>Miscellanea</b><ul> <li> NOP (which assembles to "MOV R0, R0").</ul>Many thanks to <a href="http://www.deutschlandwetter.de/">Matthias Siefert</a> <font color = "red" size = "-1">[EXTERNAL LINK]</font> for his help.<p><hr size = "3"><a href="index.html#04">Return to assembler index</a><hr size = "3"><address>Copyright © 2001 Richard Murray</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -