comparison docs/manual.docbook.sgml @ 60:9ded7e6fc1b0

Updated documentation to include recently added features
author lost@l-w.ca
date Wed, 06 Apr 2011 20:31:37 -0600
parents fd1ecc5d6e69
children 99ce348b0e6b
comparison
equal deleted inserted replaced
59:1830faeef332 60:9ded7e6fc1b0
1042 LWASM is a macro assembler. A macro is simply a name that stands in for a 1042 LWASM is a macro assembler. A macro is simply a name that stands in for a
1043 series of instructions. Once a macro is defined, it is used like any other 1043 series of instructions. Once a macro is defined, it is used like any other
1044 assembler directive. Defining a macro can be considered equivalent to adding 1044 assembler directive. Defining a macro can be considered equivalent to adding
1045 additional assembler directives. 1045 additional assembler directives.
1046 </para> 1046 </para>
1047 <para>Macros may accept parameters. These parameters are referenced within 1047
1048 a macro by the a backslash ("\") followed by a digit 1 through 9 for the first 1048 <para>Macros may accept parameters. These parameters are referenced within a
1049 macro by the a backslash ("\") followed by a digit 1 through 9 for the first
1049 through ninth parameters. They may also be referenced by enclosing the 1050 through ninth parameters. They may also be referenced by enclosing the
1050 decimal parameter number in braces ("{num}"). These parameter references 1051 decimal parameter number in braces ("{num}"). The special expansion "\*"
1051 are replaced with the verbatim text of the parameter passed to the macro. A 1052 translates to the exact parameter string, including all parameters, passed
1052 reference to a non-existent parameter will be replaced by an empty string. 1053 to the macro. These parameter references are replaced with the verbatim text
1053 Macro parameters are expanded everywhere on each source line. That means 1054 of the parameter passed to the macro. A reference to a non-existent
1054 the parameter to a macro could be used as a symbol or it could even appear 1055 parameter will be replaced by an empty string. Macro parameters are expanded
1055 in a comment or could cause an entire source line to be commented out 1056 everywhere on each source line. That means the parameter to a macro could be
1056 when the macro is expanded. 1057 used as a symbol or it could even appear in a comment or could cause an
1057 </para> 1058 entire source line to be commented out when the macro is expanded. </para>
1059
1058 <para> 1060 <para>
1059 Parameters passed to a macro are separated by commas and the parameter list 1061 Parameters passed to a macro are separated by commas and the parameter list
1060 is terminated by any whitespace. This means that neither a comma nor whitespace 1062 is terminated by any whitespace. This means that neither a comma nor whitespace
1061 may be included in a macro parameter. 1063 may be included in a macro parameter.
1062 </para> 1064 </para>
1548 counter relative addressing. In particular, the use of PC means an absolute 1550 counter relative addressing. In particular, the use of PC means an absolute
1549 offset from PC while PCR causes the assembler to calculate the offset to the 1551 offset from PC while PCR causes the assembler to calculate the offset to the
1550 specified operand and use that as the offset from PC. By setting this 1552 specified operand and use that as the offset from PC. By setting this
1551 pragma, you can have PC treated the same as PCR. </para> 1553 pragma, you can have PC treated the same as PCR. </para>
1552 1554
1555
1556 </listitem>
1557 </varlistentry>
1558
1559 <varlistentry>
1560 <term>shadow</term>
1561 <listitem>
1562
1563 <para>When this pragma is in effect, it becomes possible to define a macro
1564 that matches an internal operation code. Thus, it makes it possible to
1565 redefine either CPU instructions or pseudo operations. Because this feature
1566 is of dubious utility, it is disabled by default.</para>
1553 1567
1554 </listitem> 1568 </listitem>
1555 </varlistentry> 1569 </varlistentry>
1556 1570
1557 </variablelist> 1571 </variablelist>