News:

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

macros.asm needs fix?

Started by jag, February 04, 2007, 08:58:51 PM

Previous topic - Next topic

jag

I get these errors when I use macros.asm in my project --- and I haven't modified macros.asm at all.

\masm32\macros\macros.asm(2174) : error A2008: syntax error : equ
Case(19): Macro Called From
  \masm32\macros\macros.asm(2174): Include File
\masm32\macros\macros.asm(2176) : error A2008: syntax error : equ
Switch(1): Macro Called From
  \masm32\macros\macros.asm(2176): Include File
\masm32\macros\macros.asm(2191) : fatal error A1011: directive must be in control block
Default(1): Macro Called From
  \masm32\macros\macros.asm(2191): Include File

Any ideas?  :red

MichaelW

I have no problems. Try posting your code.
eschew obfuscation

jag

Quote from: MichaelW on February 05, 2007, 12:11:56 AM
I have no problems. Try posting your code.

That won't be needed. I figured out the problem was ObjAsm32. I'm doing work with COM so I find it to make things easier. BUT, I now see it includes a bunch of libs that make my program's size bloat and it screws up the macroing system. I'm trying to manually include the com and directx stuff but now I have new problems!  ::)

include windows.inc

include kernel32.inc
includelib kernel32.lib

include advapi32.inc
includelib advapi32.lib

include masm32.inc
includelib masm32.lib

include ObjMem32.inc
include \masm32\ObjAsm32\Code\COM\COM.inc
include \masm32\ObjAsm32\Code\COM\COM_Interfaces.inc
include \masm32\ObjAsm32\Code\COM\OAIDL.inc

include \masm32\ObjAsm32\Code\Directx\D3D9.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Math.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Math.asm
include \masm32\ObjAsm32\Code\Directx\D3D9Types.inc
include \masm32\ObjAsm32\Code\Directx\D3D9Caps.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Core.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Anim.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Mesh.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Tex.inc
include \masm32\ObjAsm32\Code\Directx\DXFile.inc
include \masm32\ObjAsm32\Code\Directx\DSound.inc

includelib \masm32\ObjAsm32\Code\Directx\Lib\D3D9.lib
includelib \masm32\ObjAsm32\Code\Directx\Lib\D3DX9.lib
includelib \masm32\ObjAsm32\Code\Directx\Lib\DSound.lib

include \masm32\macros\macros.asm

include jagHook.inc



I get these errors:
\masm32\ObjAsm32\Code\COM\COM.inc(347) : error A2008: syntax error : ,
BEGIN_INTERFACE(18): Macro Called From
  \masm32\ObjAsm32\Code\COM\COM.inc(347): Include File
\masm32\ObjAsm32\Code\COM\COM.inc(347) : fatal error A1010: unmatched block nesting
BEGIN_INTERFACE(20): Macro Called From
  \masm32\ObjAsm32\Code\COM\COM.inc(347): Include File

If I goto line 347 in COM.inc, I see


BEGIN_INTERFACE IUnknown,, <00000000-0000-0000-C000-000000000046>
  STDMETHOD   QueryInterface,   Pointer, Pointer
  STDMETHOD   AddRef
  STDMETHOD   Release
END_INTERFACE

I'm stumped again.





jag

Sorry for double posting.

I resolved that issue and now I'm back to the original errors

\masm32\macros\macros.asm(2174) : error A2008: syntax error : equ
Case(19): Macro Called From
  \masm32\macros\macros.asm(2174): Include File
\masm32\macros\macros.asm(2176) : error A2008: syntax error : equ
Switch(1): Macro Called From
  \masm32\macros\macros.asm(2176): Include File
\masm32\macros\macros.asm(2191) : fatal error A1011: directive must be in control block
Default(1): Macro Called From
  \masm32\macros\macros.asm(2191): Include File

This is what my includes look like:

.486
.model flat, stdcall
option casemap:none

include windows.inc

include kernel32.inc
includelib kernel32.lib

include user32.inc
includelib user32.lib

include advapi32.inc
includelib advapi32.lib

include masm32.inc
includelib masm32.lib

include ObjMem32.inc
include \masm32\ObjAsm32\Code\Macros\System.inc
include \masm32\ObjAsm32\Code\Macros\Objects.inc

include \masm32\ObjAsm32\Code\COM\COM.inc
include \masm32\ObjAsm32\Code\COM\COM_Interfaces.inc
include \masm32\ObjAsm32\Code\COM\OAIDL.inc

include \masm32\ObjAsm32\Code\Directx\D3D9.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Math.inc
include \masm32\ObjAsm32\Code\Directx\D3D9Types.inc
include \masm32\ObjAsm32\Code\Directx\D3D9Caps.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Core.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Anim.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Mesh.inc
include \masm32\ObjAsm32\Code\Directx\D3DX9Tex.inc
include \masm32\ObjAsm32\Code\Directx\DXFile.inc
include \masm32\ObjAsm32\Code\Directx\DSound.inc

includelib \masm32\ObjAsm32\Code\Directx\Lib\D3D9.lib
includelib \masm32\ObjAsm32\Code\Directx\Lib\D3DX9.lib
includelib \masm32\ObjAsm32\Code\Directx\Lib\DSound.lib

include \masm32\macros\macros.asm

include jagHook.inc



EDIT:::
Turns out System.inc is the culrprit and I have adjusted System.inc -- I commented out his switch macros that conflict with masms switch macros.
comment *==========================================
Switch macro Variable:req, CasReg:=<eax>
    mov    CasReg, Variable

...........more code...............

      DefaultAction
endm

*============================================


I will send Biterider a message.
He needs to:

1. add an option to not include those bulky libs
2. not conflict with masms standard include files (macros.inc)