News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Problem with conditional assembly 056.4h

Started by donkey, December 29, 2008, 04:11:16 PM

Previous topic - Next topic

donkey

Hi Jeremy,

I've found a problem with conditional assembly, the following macro has a problem with the nested #IF/#ELSE/#ENDIF blocks.

PrintError=#IF DEBUG_OFF \
#ELSE \
pushad \
pushfd \
cld \
#IF DBGWIN_SHOWONLYERRORS \
push 1 \
#ELSE \
push 0 \
#ENDIF \
push @line \
call DEBUGLIB:DbgErrorPrint \
popfd \
popad \
#ENDIF


The issues are that nothing at all is pushed for DBGWIN_SHOWONLYERRORS when it is set to 1 and when DEBUG_OFF has any value at all it skips the entire macro.

I'm using GoAsm.Exe Version 0.56.4h, this problem is not present in version 0.56.4e

EDIT: Tested it with 056.4f and it works fine, don't have a copy of 056.4g so didn't test with that version.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Edgar

Thanks for the report and I shall look into this.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

jorgon

Hi Edgar

There is also Version 0.56.4k lurking around the forum somewhere, but that also has problems with your code.

The tweak in the attached (Version 0.56.4m) works ok for me.  There was no Version 0.56.4l for sake of version number clarity.

By the way, it seems to be correct with your source that when DEBUG_OFF has any value then the rest of the macro will be skipped.  And this seems to be what you intended judging from the name you used.   However, I agree there was an issue with the PUSH coding later in the macro where there are nested #ifs and lines ending with continuation characters (instead of using MACRO .. ENDM).

Anyway hopefully this is now fixed.




[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

#3
Hi Jeremy,

Thanks for the quick update I will try it later today, the macro is part of a set I wrote years ago before ENDM was added and I have not had much reason to change them since up til now I have had no problems with them. They are run-time macros that are meant to match and add to the functionality of VKim's debug library for MASM and are distributed with the GoAsm installation of RadASM. DEBUG_OFF works as you surmised, it removes the debug code from the assembled version.

M !!! I seem to be a bit behind the times when it comes to updating GoAsm, I will have to be more diligent :)

Later - Tested it and it works great, thanks Jeremy.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable