nesdev.com
http://forums.nesdev.com/

"Incomplete expression." in ASM6 macro
http://forums.nesdev.com/viewtopic.php?f=10&t=18653
Page 2 of 2

Author:  tepples [ Sun Jul 21, 2019 12:53 pm ]
Post subject:  Re: "Incomplete expression." in ASM6 macro

ASM6 is still drunk.

I'm developing a library where features can be turned on or off at build time. The user edits a config file to set constants to zero or nonzero. Then after the config file is processed, another include file tests whether each constant has been set: if ifndef returns that the constant hasn't been set yet, it gives the constant a reasonable value. But when I was introducing support for prefixed constant and macro names in this library, ASM6's macro system started acting up.

Steps to reproduce:
Code:
asm6 -L wrongmacro.asm wrongmacro.bin && tail -n21 wrongmacro.lst


Expected behavior:
The PP_ name, transposition, and PI_ name in each db statement in the listing correspond to the macro call right above it.

Actual behavior:
The PP_ name, transposition, and PI_ name in each db statement stop corresponding to the preceding macro call soon after PSDAT_arp_waltz.

Code:
0806F                           PSDAT_arp_waltz:  ; title: Arpeggio Waltz
0806F                           PENTLY_playPatSq2 PP_arp_waltz_melody, 24, PI_stringlead
0806F 01 0C 18 01               db PENTLY_CON_PLAYPAT|1, PP_arp_waltz_melody, 24, PI_stringlead
08073                           PENTLY_playPatSq1 PP_arp_waltz_bass1, 1, PI_toot0
08073 00 03 23 01               db PENTLY_CON_PLAYPAT|0, PP_bf98_melodyB1, 35, PI_bf98_flute
08077                           PENTLY_waitRows 39  ; end at 0:17.00
08077 20 26                     db PENTLY_CON_WAITROWS, (39)-1
08079                           PENTLY_playPatSq1 PP_arp_waltz_bass2, 3, PI_toot0
08079 00 05 12 00               db PENTLY_CON_PLAYPAT|0, PP_bf98_bassB1, 18, PI_bass
0807D                           PENTLY_waitRows 9  ; end at 0:20.00
0807D 20 3E                     db PENTLY_CON_WAITROWS, (63)-1
0807F                           PENTLY_playPatSq1 PP_arp_waltz_bass1, 1, PI_toot0
0807F 00 00 01 03               db PENTLY_CON_PLAYPAT|0, PP_bf98_drums_tripletfill, 1, PI_toot0
08083                           PENTLY_waitRows 39  ; end at 0:33.00
08083 20 08                     db PENTLY_CON_WAITROWS, (9)-1
08085                           PENTLY_playPatSq1 PP_arp_waltz_bass2, 3, PI_toot0
08085 00 00 03 03               db PENTLY_CON_PLAYPAT|0, PP_bf98_drums, 3, PI_toot0
08089                           PENTLY_waitRows 9  ; end at 0:36.00
08089 20 11                     db PENTLY_CON_WAITROWS, (18)-1
0808B                           PENTLY_dalSegno
0808B 23                        db PENTLY_CON_DALSEGNO


I guess I could find some other way to provide defaults.

Attachments:
wrongmacro.asm [9.41 KiB]
Downloaded 36 times

Page 2 of 2 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/