MLIST - List macro expansions

Syntax
MLIST [ON|OFF] 
Description

When the ON keyword is entered with an MLIST directive, the Assembler includes the macro expansions in the listing and in the debug file.

When the OFF keyword is entered, the macro expansions are omitted from the listing and from the debug file.

This directive is not written to the listing and debug file, and the default value is ON.

Synonym

None

Example

The assembly code in the following listing, with MLIST ON, generates the assembler output listing in the next listing.

Listing: Example assembly source code using MLIST

        XDEF entry
        MLIST ON

swap: MACRO

        LD D6, \1

        LD X, \2

        ST D6, \2

        ST X, \1

        ENDM

codSec: SECTION

entry:

        LD D6, #$F0

        LD X, #$0F

main:

        ST D6, first

        ST X, second

        swap first, second

        NOP

        BRA   main

datSec: SECTION

first: DS.B 1

second: DS.B 1
Listing: Assembler Output

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

  1    1                   XDEF entry

  3    3                  swap: MACRO

  4    4                   LD D6, \1

  5    5                   LD X, \2

  6    6                   ST D6, \2

  7    7                   ST X, \1

  8    8                      

  9    9                   ENDM

   10   10                      codSec: SECTION

   11   11                      entry:

   12   12   000000 9600 0000           LD D6, #$F0

             000004 F0

   13   13   000005 A87F                LD X, #$0F

   14   14                      main:

   15   15   000007 D6xx xxxx           ST D6, first

   16   16   00000B C800 xxxx           ST X, second

             00000F xx

   17   17                   swap first, second

   18    4m  000010 B6xx xxxx  +        LD D6, first

   19    5m  000014 A800 xxxx  +        LD X, second

             000018 xx         

   20    6m  000019 D6xx xxxx  +        ST D6, second

   21    7m  00001D C800 xxxx  +        ST X, first

             000021 xx

   22    8m                    +

   23   18   000022 01                  NOP

   24   19   000023 20FF E4             BRA main

   25   20                      datSec: SECTION

   26   21   000000             first: DS.B 1

   27   22   000001             second: DS.B 1

For the same code, with MLIST OFF, the listing file is as shown in the following listing.

Listing: Assembler Output

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

    1    1                          XDEF entry

    3    3                     swap:MACRO

    4    4                          LD D6, \1

    5    5                          LD X, \2

    6    6                          ST D6, \2

    7    7                          ST X \1

    8    8

    9    9                          ENDM

   10   10                    codSec: SECTION

   11   11                    entry:

   12   12   000000 9600 0000       LD D6, #$F0

         000004 F0

   13   13   000005 A87F            LD X, #$0F

   14   14                    main:

   15   15   000007 D6xx xxxx       ST D6, first

   16   16   00000B C800 xxxx       ST X, second

          00000F xx

   17   17                            swap first, second

   23   18   000022 01                NOP

   24   19   000023 20FF E4           BRA main

   25   20                    datSec: SECTION

   26   21   000000           first:  DS.B 1

   27   22   000001           second: DS.B 1

The MLIST directive does not appear in the listing file. When a macro is called after a MLIST ON, it is expanded in the listing file. If the MLIST OFF is encountered before the macro call, the macro is not expanded in the listing file.