# HG changeset patch # User lost # Date 1261457579 0 # Node ID 6e2d03188d240dfd29e4cf7d1d691b220ab92a94 # Parent 6363b9ebf8257d8254727312b102ecb5307babbc Updated manual to reflect updates for 2.6 release diff -r 6363b9ebf825 -r 6e2d03188d24 doc/manual.docbook.sgml --- 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 @@ + + + + +Add to the end of the include path. + + + + + @@ -397,8 +407,11 @@ the operand fields. Symbols, however, are case sensitive. - -LWASM does not support line numbers in the file. + 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. @@ -639,6 +652,15 @@ as converting the file contents to a series of FCB statements and including those at the current assembly point. + + If filename 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. + + Please note that absolute path detection including drive letters will +not function correctly on Windows platforms. Non-absolute inclusion will +work, however. + @@ -1041,6 +1063,96 @@
+Structures + + +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. + + + + + +structname STRUCT + + + +This directive is used to begin the definition of a structure with name +structname. Subsequent statements all form part of +the structure definition until the end of the structure is declared. + + + + + +ENDSTRUCT + + +This directive ends the definition of the structure. + + + + + + + +Within a structure definition, only reservation pseudo ops are permitted. +Anything else will cause an assembly error. + + + 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. + + +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 + + +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. + +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. + +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). + +
+ +
Object Files and Sections 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. + + +symEXTDEP + + +This directive forces an external dependency on +sym, even if it is never referenced anywhere else in +this file. + + +
@@ -1888,7 +2011,7 @@ FF -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. +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).