# HG changeset patch # User lost # Date 1244765184 0 # Node ID 4c60c3a09597be57cde780593015e2bc9012dc31 # Parent c8787fad0f9fd05eed72e704a52d51250b72fec1 Various updates to the manual diff -r c8787fad0f9f -r 4c60c3a09597 doc/manual.docbook.sgml --- a/doc/manual.docbook.sgml Fri Jun 12 00:06:13 2009 +0000 +++ b/doc/manual.docbook.sgml Fri Jun 12 00:06:24 2009 +0000 @@ -98,18 +98,33 @@ object files into a final binary in any of LWLINK's supported binary formats. -Object files are very flexible in that they allow references that are not -known at assembly time to be resolved at link time. However, because the -addresses of such references are not known, there is no way for the assembler -has to use sixteen bit addressing modes for these references. The linker -will always use sixteen bits when resolving a reference which means any -instruction that requires an eight bit operand cannot use external references. - - Object files also support the concept of sections which are not valid for other output types. This allows related code from each object file linked to be collapsed together in the final binary. + +Object files are very flexible in that they allow references that are not +known at assembly time to be resolved at link time. However, because the +addresses of such references are not known at assembly time, there is no way +for the assembler to deduce that an eight bit addressing mode is possible. +That means the assember will default to using sixteen bit addressing +whenever an external or cross-section reference is used. + + + +As of LWASM 2.4, it is possible to force direct page addressing for an +external reference. Care must be taken to ensure the resulting addresses +are really in the direct page since the linker does not know what the direct +page is supposed to be and does not emit errors for byte overflows. + + + +It is also possible to use external references in an eight bit immediate +mode instruction. In this case, only the low order eight bits will be used. +Again, no byte overflows will be flagged. + + + @@ -367,17 +382,35 @@ prefixing the characters with a quote ("). -LWASM supports the following basic binary operators: +, -, *, /, and %. -These represent addition, subtraction, multiplication, division, and modulus. -It also supports unary negation and unary 1's complement (- and ^ respectively). -For completeness, a unary positive (+) is supported though it is a no-op. + +LWASM supports the following basic binary operators: +, -, *, /, and %. +These represent addition, subtraction, multiplication, division, and +modulus. It also supports unary negation and unary 1's complement (- and ^ +respectively). It is also possible to use ~ for the unary 1's complement +operator. For completeness, a unary positive (+) is supported though it is +a no-op. LWASM also supports using |, &, and ^ for bitwise or, bitwise and, +and bitwise exclusive or respectively. + -Operator precedence follows the usual rules. multiplication, division, -and modulus take precedence over addition and subtraction. Unary operators -take precedence over binary operators. To force a specific order of evaluation, + + +Operator precedence follows the usual rules. Multiplication, division, and +modulus take precedence over addition and subtraction. Unary operators take +precedence over binary operators. Bitwise operators are lower precdence +than addition and subtraction. To force a specific order of evaluation, parentheses can be used in the usual manner. + + + + +As of LWASM 2.5, the operators && and || are recognized for boolean and and +boolean or respectively. They will return either 0 or 1 (false or true). +They have the lowest precedence of all the binary operators. + + +
@@ -520,6 +553,19 @@ + + +INCLUDEBIN filename + + +Treat the contents of filename as a string of bytes to +be included literally at the current assembly point. This has the same effect +as converting the file contents to a series of FCB statements and including +those at the current assembly point. + + + +
@@ -1095,6 +1141,19 @@ +importundefexport + + +This pragma is only valid for targets that support external references. When +in force, it will cause the EXPORT directive to act as IMPORT if the symbol +to be exported is not defined. This is provided for compatibility with the +output of gcc6809 and should not be used in hand written code. Because of +the confusion this pragma can cause, it is disabled by default. + + + + + undefextern