comparison doc/lwasm.txt @ 331:ed3553296580

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