changeset 256:6e2d03188d24 2.x

Updated manual to reflect updates for 2.6 release
author lost
date Tue, 22 Dec 2009 04:52:59 +0000
parents 6363b9ebf825
children e27279180a73
files doc/manual.docbook.sgml
diffstat 1 files changed, 126 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/manual.docbook.sgml	Sun Dec 20 05:40:47 2009 +0000
+++ b/doc/manual.docbook.sgml	Tue Dec 22 04:52:59 2009 +0000
@@ -286,6 +286,16 @@
 </varlistentry>
 
 <varlistentry>
+<term><option>--includedir=path</option></term>
+<term><option>-I path</option></term>
+<listitem>
+<para>
+Add <option>path</option> to the end of the include path.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
 <term><option>--help</option></term>
 <term><option>-?</option></term>
 <listitem>
@@ -397,8 +407,11 @@
 the operand fields. Symbols, however, are case sensitive.
 </para>
 
-<para>
-LWASM does not support line numbers in the file.
+<para> As of version 2.6, LWASM supports files with line numbers.  If line
+numbers are present, the line must start with a digit.  The line number
+itself must consist only of digits.  The line number must then be followed
+by either the end of the line or exactly one white space character.  After
+that white space character, the lines are interpreted exactly as above. 
 </para>
 
 </section>
@@ -639,6 +652,15 @@
 as converting the file contents to a series of FCB statements and including
 those at the current assembly point.
 </para>
+
+<para> If <parameter>filename</parameter> beings with a /, the file name
+will be taken as absolute.  Otherwise, the current directory will be
+searched followed by the search path in the order specified.</para>
+
+<para> Please note that absolute path detection including drive letters will
+not function correctly on Windows platforms.  Non-absolute inclusion will
+work, however.</para>
+
 </listitem>
 </varlistentry>
 
@@ -1041,6 +1063,96 @@
 </section>
 
 <section>
+<title>Structures</title>
+<para>
+
+Structures are used to group related data in a fixed structure. A structure
+consists a number of fields, defined in sequential order and which take up
+specified size.  The assembler does not enforce any means of access within a
+structure; it assumes that whatever you are doing, you intended to do. 
+There are two pseudo ops that are used for defining structures.
+
+</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>structname</parameter> STRUCT</term>
+<listitem>
+<para>
+
+This directive is used to begin the definition of a structure with name
+<parameter>structname</parameter>.  Subsequent statements all form part of
+the structure definition until the end of the structure is declared.
+
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>ENDSTRUCT</term>
+<listitem>
+<para>
+This directive ends the definition of the structure.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<para>
+
+Within a structure definition, only reservation pseudo ops are permitted.
+Anything else will cause an assembly error.
+</para>
+
+<para> Once a structure is defined, you can reserve an area of memory in the
+same structure by using the structure name as the opcode.  Structures can
+also contain fields that are themselves structures.  See the example
+below.</para>
+
+<programlisting>
+tstruct2  STRUCT
+f1        rmb 1
+f2        rmb 1
+          ENDSTRUCT
+
+tstruct   STRUCT
+field1    rmb 2
+field2    rmb 3
+field3    tstruct2
+          ENDSTRUCT
+
+          ORG $2000
+var1      tstruct
+var2      tstruct2
+</programlisting>
+
+<para>Fields are referenced using a dot (.) as a separator. To refer to the
+generic offset within a structure, use the structure name to the left of the
+dot.  If referring to a field within an actual variable, use the variable's
+symbol name to the left of the dot.</para>
+
+<para>You can also refer to the actual size of a structure (or a variable
+declared as a structure) using the special symbol sizeof{structname} where
+structname will be the name of the structure or the name of the
+variable.</para>
+
+<para>Essentially, structures are a shortcut for defining a vast number of
+symbols.  When a structure is defined, the assembler creates symbols for the
+various fields in the form structname.fieldname as well as the appropriate
+sizeof{structname} symbol.  When a variable is declared as a structure, the
+assembler does the same thing using the name of the variable.  You will see
+these symbols in the symbol table when the assembler is instructed to
+provide a listing.  For instance, the above listing will create the
+following symbols (symbol values in parentheses): tstruct2.f1 (0),
+tstruct2.f2 (1), sizeof{tstruct2} (2), tstruct.field1 (0), tstruct.field2
+(2), tstruct.field3 (5), tstruct.field3.f1 (5), tstruct.field3.f2 (6),
+sizeof{tstruct.field3} (2), sizeof{tstruct} (7), var1 {$2000}, var1.field1
+{$2000}, var1.field2 {$2002}, var1.field3 {$2005}, var1.field3.f1 {$2005},
+var1.field3.f2 {$2006}, sizeof(var1.field3} (2), sizeof{var1} (7), var2
+($2007), var2.f1 ($2007), var2.f2 ($2008), sizeof{var2} (2).  </para>
+
+</section>
+
+<section>
 <title>Object Files and Sections</title>
 <para>
 The object file target is very useful for large project because it allows
@@ -1200,8 +1312,19 @@
 take precedence over any operand that is present.
 </para>
 </listitem>
+
 </varlistentry>
 
+<varlistentry>
+<term><parameter>sym</parameter>EXTDEP</term>
+<listitem>
+
+<para>This directive forces an external dependency on
+<parameter>sym</parameter>, even if it is never referenced anywhere else in
+this file.</para>
+
+</listitem>
+</varlistentry>
 </variablelist>
 
 </section>
@@ -1888,7 +2011,7 @@
 
 <row>
 <entry>FF</entry>
-<entry>This term will set flags for the expression. Each one of these terms will set a single flag. All of them should be specified first in an expression. If they are not, the behaviour is undefined. The byte following is the flag. There is currently only one flag defined. Flag 01 indicates an 8 bit relocation.</entry>
+<entry>This term will set flags for the expression. Each one of these terms will set a single flag. All of them should be specified first in an expression. If they are not, the behaviour is undefined. The byte following is the flag. Flag 01 indicates an 8 bit relocation. Flag 02 indicates a zero-width relocation (see the EXTDEP pseudo op in LWASM).</entry>
 </row>
 </tbody>
 </tgroup>