Michael Alcorn wrote: > The directives EXPAND and NOEXPAND and the command line option m+, > m- seem to have no effect on the output of my listing file. At the > point in the file where the macro is defined, each step is > "expanded" for each invocation of the macro in the source file. > .... > beq macro addr > 00000b 1903 BTFSC 0x3,0x2 btfsc STATUS,Z > 00000e 1903 BTFSC 0x3,0x2 > 00000c 2807 GOTO 0x7 goto addr > 00000f 2807 GOTO 0x7 > endm > > The list file is as follows at the point where I invoked this macro. > > 00000a 01a1 CLRF 0x21 clrf count > beq start > 00000d 0000 NOP nop > beq start Michael: In the example you've shown, macros are NOT expanded; note that no opcodes are shown for addresses 0x000b and 0x000c. If you get this result whether or not there's an "EXPAND" directive at the start of your source file, it's because: a) There's a "NOEXPAND" directive later in the code (or inside a macro or something), or b) the /m- switch is set on the command line (or the "Macro Expansion" button in the MPASMWIN dialog box is set to "off"), or c) you're not using the directive correctly (maybe it's not indented, or perhaps you've managed to misspell it somehow). > Also what would be the purpose of not expanding the macros? Complex macros are often very difficult to read; once you're sure that the macro is evaluating properly, it's generally much easier to read the code WITHOUT the full expansion. Also, macro expansion takes up a lot of room in the list file. I just assembled some old 16C77 code and got these results: NOEXPAND: List file is 14145 lines (151 pages) long, 884 KB EXPAND: List file is 29097 lines (310 pages) long, 1780 KB -Andrew === Andrew Warren --- aiw@cypress.com === IPD Systems Engineering, CYSD === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics