-L: Generate a listing file

Group

Output

Scope

Assembly unit

Syntax
  -L[=<dest>]
  
  
Arguments

<dest>: the name of the listing file to be generated.

It may contain special modifiers (see Using special modifiers).

Default

No generated listing file

Description

Switches on the generation of the listing file. If dest is not specified, the listing file will have the same name as the source file, but with extension *.lst. The listing file contains macro definition, invocation, and expansion lines as well as expanded include files.

Example
  ASMOPTIONS=-L
  
  

In the following example of assembly code, the cpChar macro accepts two parameters. The macro copies the value of the first parameter to the second one.

When the -L option is specified, the portion of assembly source code in the following listing, together with the code from an include file ( Listing: Example source code from an include file) generates the output listing in Listing: Assembly output listing.

Listing: Example assembly source code

         XDEF Start
MyData:  SECTION

char1:   DS.B  1

char2:   DS.B  1

         INCLUDE "macro.inc"

CodeSec: SECTION

Start:

         cpChar char1, char2

         NOP
Listing: Example source code from an include file

cpChar: MACRO
        LD D0, \1

        ST D0, \2

        ENDM
Listing: Assembly output listing

 Abs. Rel.   Loc    Obj. code  Source line
 ---- ----   ------ ---------  -----------

    1    1                              XDEF  Start

    2    2                     MyData:  SECTION

    3    3   000000            char1:   DS.B  1

    4    4   000001            char2:   DS.B  1

    5    5                              INCLUDE "macro.inc"

    6    1i                    cpChar:  MACRO

    7    2i                             LD D0,   \1

    8    3i                             ST D0,   \2

    9    4i                             ENDM

   10    6                     CodeSec: SECTION

   11    7                     Start:

   12    8                              cpChar char1, char2

   13    2m  000000 xx xxxx   +         LD D0,   char1

   14    3m  000003 xx xxxx   +         ST D0,   char2

   15    9   000006 01                  NOP

The Assembler stores the content of included files in the listing file. The Assembler also stores macro definitions, invocations, and expansions in the listing file.

For a detailed description of the listing file, see the Assembler Listing File chapter.

See also

Assembler options: