hello

I am having trouble with a macro, could you guys tell why it is not working.
Its purpose is to align a string, and I am using it only in the data section.

STRING MACRO Args:VARARG
  LOCAL Name
  .Data
    Align 4
    Name db Args,0
  Exitm <Name>
ENDM


szClave gives me an error when I use "=" but if I change it to TEXTEQU it works.

.data
szMensaje = STRING ("Ha ocurrido un error.")
szTitulo  = STRING ("Programa #1")
szClave  = STRING (01Bh,30h,03Ch,18h,27h,010h,28h)


I have seen a similar macro that receives 2 parameters, I have change it to 1 for aesthetic reasons in my asm source :)
thank you

Posted on 2005-06-29 19:49:10 by Chambao
Chambao,

What is the error?? Why do you have a .Data directive in the MACRO if you only use it in the data section?? Does that MACRO really save you that much typing?? Ratch


Align 4
szTry BYTE 01Bh,30h,03Ch,18h,27h,010h,28h,0


instead of


szClave? ?= STRING (01Bh,30h,03Ch,18h,27h,010h,28h)
Posted on 2005-06-29 22:53:02 by Ratch
Hi Ratch

the error is "invalid instruction operands" and the line of code where the error occurs is
xcall send, hSocket, offset szClave, sizeof szClave, 0

xcall is a macro similar to invoke
well it doesn't save me that much typing, but i am a crazy being and i do not like to use 2 lines to declare a string becaus there are lots :oops:
Posted on 2005-06-30 02:22:34 by Chambao
Chambao,
? ? How about posting a listing which includes the xcall MACRO definition and call, and the minimum amount of code to demonstrate the error.? Invoke is not a macro, by the way.? It is a built in MASM command.? Ratch
Posted on 2005-06-30 10:51:42 by Ratch