The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Ficko on July 26, 2010, 02:13:39 PM

Title: error A2039:line too long
Post by: Ficko on July 26, 2010, 02:13:39 PM
How to solve this quirk?

I am getting nuts on it. :green


.686p
.model flat, stdcall
option casemap :none
MySub PROTO :DWORD
; ##########################################
Pilot EQU <pilot>
pilot MACRO Var
EXITM <eax>
ENDM
; ##########################################
.code
start:
invoke MySub,Pilot(esi)
; ##########################################
MySub Proc Param
xor eax, eax
MySub endp
end start


Basically I want different cases mapped to the same macro like "pilot","Pilot","PILOT".
It works fine with EQU until I have a MACRO with return parameter - function macro -
Title: Re: error A2039:line too long
Post by: jj2007 on July 26, 2010, 02:53:17 PM
This works.
Pilot MACRO Var
  EXITM pilot(Var)
ENDM
pilot MACRO Var
  EXITM <eax>
ENDM


Now if you really want to go nuts: This also works, in Masm and JWasm :green

include \masm32\include\masm32rt.inc

MySub PROTO :DWORD

Pilot equ pilot

pilot MACRO Var
  EXITM <eax>
ENDM


.code
start:
invoke MySub, Pilot(esi)

MySub Proc Param
xor eax, eax
ret
MySub endp

end start
Title: Re: error A2039:line too long
Post by: Ficko on July 26, 2010, 03:27:37 PM
Quote from: jj2007 on July 26, 2010, 02:53:17 PM
Now if you really want to go nuts: This also works, in Masm and JWasm :green

include \masm32\include\masm32rt.inc

MySub PROTO :DWORD

Pilot equ pilot

pilot MACRO Var
  EXITM <eax>
ENDM


.code
start:
invoke MySub, Pilot(esi)

MySub Proc Param
xor eax, eax
ret
MySub endp

end start


Hm.. this actually the same I have posted the only change is
Pilot equ <pilot> -> Pilot equ pilot

and dosn't work by me. :eek

But the first one seems to work :U have to do some more tests my actual macro isn't that simple. :P
Title: Re: error A2039:line too long
Post by: dedndave on July 26, 2010, 03:30:48 PM
i don't know if this will help...
Pilot TEXTEQU <pilot>
Title: Re: error A2039:line too long
Post by: Ficko on July 26, 2010, 03:46:35 PM
Quote from: dedndave on July 26, 2010, 03:30:48 PM
i don't know if this will help...
Pilot TEXTEQU <pilot>

Nop but thanks anyway. :lol

JJ's first try is working so if there no other way I will stick to it. :toothy


Pilot MACRO Var
  EXITM pilot(Var)
ENDM
pilot MACRO Var
  EXITM <eax>
ENDM