annotate old-trunk/doc/lwasm.txt @ 339:eb230fa7d28e

Prepare for migration to hg
author lost
date Fri, 19 Mar 2010 02:54:14 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
1 LWASM 2.0
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
2 =========
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
3
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
4 LWASM is a cross-assembler for the MC6809 and HD6309 CPUs. It should
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
5 assemble most reasonable EDTASM compatible source code. This document is not
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
6 intended to teach assembly language for these CPUs but rather to document
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
7 the behaviour of LWASM.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
8
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
9
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
10 TARGETS
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
11 -------
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
12
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
13 LWASM supports several targets for assembly. These are decb, raw, and obj.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
14
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
15 The raw target generates a raw binary output. This is useful for building
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
16 ROMs and other items that are not intended to be loaded by any kind of
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
17 loader. In this mode, the ORG directive is merely advisory and does not
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
18 affect the output except for the addresses symbols are defined to have.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
19
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
20 The decb target generates output that can be loaded with the CLOADM or LOADM
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
21 commands in Color Basic. There will be approximately one segment in the
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
22 output file for every ORG statement after which any code is emitted. (That
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
23 is, two ORG statements in a row will not generate two output segments.)
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
24 This is approximately equivalent to running A/AO in EDTASM.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
25
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
26 The obj target generates output that is intended to be linked later with
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
27 LWLINK. This target disallows the use of ORG for defining anything other
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
28 than constants. In this target, source files consist of a number of sections
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
29 (SECTION/ENDSECTION). Nothing outside of a section is permitted to cause any
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
30 output at all. Use of an ORG statement within a section is an error. This
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
31 target also permits tagging symbols for export (EXPORT) and marking a symbol
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
32 as externally defined (IMPORT/EXTERN). The linker will resolve any external
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
33 references at link time. Additionally, any inter-section references will be
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
34 resolved by the linker. All code in each section is assembled with an
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
35 implicit origin of 0. SETDP has no effect because the assembler has no idea
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
36 what address the linker will assign to the code when it is linked. Any
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
37 direct addressing modes will default to extended to allow for the linker to
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
38 perform relocations. Intersegment references and external references will
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
39 use 16 bit relative addressing but intrasegment internal references may use
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
40 8 bit relative addressing. Forced 8 bit direct modes are probably an error
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
41 but are permitted on the theory that the programmer might know something the
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
42 assembler doesn't.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
43