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

          LDA   \1

          LDX   \2

          STA   \2

          STX   \1

       ENDM

codSec: SECTION

entry:

        LDA   #$F0

        LDX   #$0F

main:

        STA   first

        STX   second

        swap  first, second

        NOP

        BRA   main

datSec: SECTION

first:  DS.B  1

second: DS.B  1

The following listing shows the output of the example assembly source code using MLIST listed above:

Listing: Assembler Output

    1    1                              XDEF  entry
    3    3                      swap:   MACRO

    4    4                                LDA   \1

    5    5                                LDX   \2

    6    6                                STA   \2

    7    7                                STX   \1

    8    8                              ENDM

    9   9

   10   10                      codSec: SECTION

   11   11                      entry:

   12   12   000000 A6F0                LDA   #$F0

   13   13   000002 AE0F                LDX   #$0F

   14   14                      main:

   15   15   000004 C7 xxxx             STA   first

   16   16   000007 CF xxxx             STX   second

   17   17                              swap  first, second

   18    4m  00000A C6 xxxx    +          LDA   first

   19    5m  00000D CE xxxx    +          LDX   second

   20    6m  000010 C7 xxxx    +          STA   second

   21    7m  000013 CF xxxx    +          STX   first

   22   18   000016 9D                  NOP

   23   19   000017 20EB                BRA   main

   24   20

   25   21                      datSec: SECTION

   26   22   000000             first:  DS.B  1

   27   23   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                          LDA   \1

    5    5                          LDX   \2

    6    6                          STA   \2

    7    7                          STX   \1

    8    8                          ENDM

    9    9                    codSec: SECTION

   10   10                    entry:

   11   11   000000 A6F0              LDA #$F0

   12   12   000002 AE0F              LDX #$0F

   13   13                    main:

   14   14   000004 C7 xxxx           STA first

   15   15   000007 CF xxxx           STX second

   16   16                            swap first, second

   21   17   000016 9D                NOP

   22   18   000017 20EB              BRA main

   23   19                    datSec: SECTION

   24   20   000000           first:  DS.B 1

   25   21   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.