comparison doc/manual.docbook.sgml @ 175:f8ec28ace0c6

Updated docs to reflect recent changes
author lost
date Tue, 03 Mar 2009 01:27:24 +0000
parents 751b99efb1fc
children bc2fae9438eb
comparison
equal deleted inserted replaced
174:cc41ccee8f64 175:f8ec28ace0c6
302 thing present on the line other than the comment, the comment character is 302 thing present on the line other than the comment, the comment character is
303 mandatory to prevent the assembler from interpreting the comment as an opcode. 303 mandatory to prevent the assembler from interpreting the comment as an opcode.
304 </para> 304 </para>
305 305
306 <para> 306 <para>
307 For compatibility with the output generated by some C preprocessors, LWASM
308 will also ignore lines that begin with a #. This should not be used as a general
309 comment character, however.
310 </para>
311
312 <para>
307 The opcode is not treated case sensitively. Neither are register names in 313 The opcode is not treated case sensitively. Neither are register names in
308 the operand fields. Symbols, however, are case sensitive. 314 the operand fields. Symbols, however, are case sensitive.
309 </para> 315 </para>
310 316
311 <para> 317 <para>
337 </section> 343 </section>
338 344
339 <section> 345 <section>
340 <title>Numbers and Expressions</title> 346 <title>Numbers and Expressions</title>
341 <para> 347 <para>
342 Numbers can be expressed in binary, octal, decimal, or hexadecimal. 348
343 Binary numbers may be prefixed with a "%" symbol or suffixed with a 349 Numbers can be expressed in binary, octal, decimal, or hexadecimal. Binary
344 "b" or "B". Octal numbers may be prefixed with "@" or suffixed with 350 numbers may be prefixed with a "%" symbol or suffixed with a "b" or "B".
345 "Q", "q", "O", or "o". Hexadecimal numbers may be prefixed with "$" or 351 Octal numbers may be prefixed with "@" or suffixed with "Q", "q", "O", or
346 suffixed with "H". No prefix or suffix is required for decimal numbers but 352 "o". Hexadecimal numbers may be prefixed with "$", "0x" or "0X", or suffixed
347 they can be prefixed with "&amp;" if desired. Any constant which begins with 353 with "H". No prefix or suffix is required for decimal numbers but they can
348 a letter must be expressed with the correct prefix base identifier or be 354 be prefixed with "&amp;" if desired. Any constant which begins with a letter
349 prefixed with a 0. Thus hexadecimal FF would have to be written either 0FFH 355 must be expressed with the correct prefix base identifier or be prefixed
350 or $FF. Numbers are not case sensitive. 356 with a 0. Thus hexadecimal FF would have to be written either 0FFH or $FF.
357 Numbers are not case sensitive.
358
351 </para> 359 </para>
352 360
353 <para> A symbol may appear at any point where a number is acceptable. The 361 <para> A symbol may appear at any point where a number is acceptable. The
354 special symbol "*" can be used to represent the starting address of the 362 special symbol "*" can be used to represent the starting address of the
355 current source line within expressions. </para> 363 current source line within expressions. </para>
1236 1244
1237 <section> 1245 <section>
1238 <title>Linker Operation</title> 1246 <title>Linker Operation</title>
1239 1247
1240 <para> 1248 <para>
1241 LWLINK takes one or more files in the LWTOOLS object file format and links 1249
1242 them into a single binary. While the precise method is slightly different, 1250 LWLINK takes one or more files in supported input formats and links them
1243 linking can be conceptualized as the following steps. 1251 into a single binary. Currently supported formats are the LWTOOLS object
1252 file format and the archive format used by LWAR. While the precise method is
1253 slightly different, linking can be conceptualized as the following steps.
1254
1244 </para> 1255 </para>
1245 1256
1246 <orderedlist> 1257 <orderedlist>
1247 <listitem> 1258 <listitem>
1248 <para> 1259 <para>
1379 1390
1380 </section> 1391 </section>
1381 1392
1382 </chapter> 1393 </chapter>
1383 1394
1395 <chapter>
1396 <title>Libraries and LWAR</title>
1397
1398 <para>
1399 LWTOOLS also includes a tool for managing libraries. These are analogous to
1400 the static libraries created with the "ar" tool on POSIX systems. Each library
1401 file contains one or more object files. The linker will treat the object
1402 files within a library as though they had been specified individually on
1403 the command line except when resolving external references. External references
1404 are looked up first within the object files within the library and then, if
1405 not found, the usual lookup based on the order the files are specified on
1406 the command line occurs.
1407 </para>
1408
1409 <para>
1410 The tool for creating these libary files is called LWAR.
1411 </para>
1412
1413 <section>
1414 <title>Command Line Options</title>
1415 <para>
1416 The binary for LWAR is called "lwar". Note that the binary is in lower
1417 case. The options lwar understands are listed below. For archive manipulation
1418 options, the first non-option argument is the name of the archive. All other
1419 non-option arguments are the names of files to operate on.
1420 </para>
1421
1422 <variablelist>
1423 <varlistentry>
1424 <term><option>--add</option></term>
1425 <term><option>-a</option></term>
1426 <listitem>
1427 <para>
1428 This option specifies that an archive is going to have files added to it.
1429 If the archive does not already exist, it is created. New files are added
1430 to the end of the archive.
1431 </para>
1432 </listitem>
1433 </varlistentry>
1434
1435 <varlistentry>
1436 <term><option>--create</option></term>
1437 <term><option>-c</option></term>
1438 <listitem>
1439 <para>
1440 This option specifies that an archive is going to be created and have files
1441 added to it. If the archive already exists, it is truncated.
1442 </para>
1443 </listitem>
1444 </varlistentry>
1445
1446 <varlistentry>
1447 <term><option>--merge</option></term>
1448 <term><option>-m</option></term>
1449 <listitem>
1450 <para>
1451 If specified, any files specified to be added to an archive will be checked
1452 to see if they are archives themselves. If so, their constituent members are
1453 added to the archive. This is useful for avoiding archives containing archives.
1454 </para>
1455 </listitem>
1456 </varlistentry>
1457
1458 <varlistentry>
1459 <term><option>--list</option></term>
1460 <term><option>-l</option></term>
1461 <listitem>
1462 <para>
1463 This will display a list of the files contained in the archive.
1464 </para>
1465 </listitem>
1466 </varlistentry>
1467
1468 <varlistentry>
1469 <term><option>--debug</option></term>
1470 <term><option>-d</option></term>
1471 <listitem>
1472 <para>
1473 This option increases the debugging level. It is only useful for LWTOOLS
1474 developers.
1475 </para>
1476 </listitem>
1477 </varlistentry>
1478
1479 <varlistentry>
1480 <term><option>--help</option></term>
1481 <term><option>-?</option></term>
1482 <listitem>
1483 <para>
1484 This provides a listing of command line options and a brief description
1485 of each.
1486 </para>
1487 </listitem>
1488 </varlistentry>
1489
1490 <varlistentry>
1491 <term><option>--usage</option></term>
1492 <listitem>
1493 <para>
1494 This will display a usage summary.
1495 of each.
1496 </para>
1497 </listitem>
1498 </varlistentry>
1499
1500
1501 <varlistentry>
1502 <term><option>--version</option></term>
1503 <term><option>-V</option></term>
1504 <listitem>
1505 <para>
1506 This will display the version of LWLINK.
1507 of each.
1508 </para>
1509 </listitem>
1510 </varlistentry>
1511
1512 </section>
1513
1514 </chapter>
1515
1384 <chapter id="objchap"> 1516 <chapter id="objchap">
1385 <title>Object Files</title> 1517 <title>Object Files</title>
1386 <para> 1518 <para>
1387 LWTOOLS uses a proprietary object file format. It is proprietary in the sense 1519 LWTOOLS uses a proprietary object file format. It is proprietary in the sense
1388 that it is specific to LWTOOLS, not that it is a hidden format. It would be 1520 that it is specific to LWTOOLS, not that it is a hidden format. It would be