NO

Author Topic: Bug: PoASM confused by "FORC ... ENDM"  (Read 6604 times)

japheth

  • Guest
Bug: PoASM confused by "FORC ... ENDM"
« on: June 14, 2007, 01:48:10 PM »
Hello,

PoASM has problems with this test case

Code: [Select]

        .model flat, stdcall

xtest   macro x:req
local y
ifndef __POASM__
        forc chr$,x
        endm
else
y       textequ x
endif
        exitm <y>
        endm

_TEXT   segment
        mov eax,xtest(1)
        ret
_TEXT   ends

        end

PoASM displays

fatal error: invalid use of 'ELSE'       

because it apparently doesn't expect the first ENDM (which "belongs" to the FORC "instruction" and which PoASM should ignore entirely).

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Bug: PoASM confused by "FORC ... ENDM"
« Reply #1 on: July 08, 2007, 01:41:23 PM »
Not a bug. If you have code with bad syntax you must put the IF* directives at the global level (creating two versions of the macro). You can embed IF* directives in macro, but only when the syntax is correct, and then the IF* expression will be evaluated when the macro is *expanded*.
/Pelle