Page 3 of 3
Posted: Sun Apr 03, 2005 12:40 am
by npath
@Jack,
Thanks for the link!
Posted: Sun Apr 03, 2005 3:13 am
by El_Choni
Fasm macros are cool, but I think they're not very useful if you want to deal with PB's code (variables and stuff). I would wait for PB's macros, those will be useful, I'm sure.
Posted: Sun Apr 03, 2005 3:56 am
by Xombie
If I knew how Japbe plugin stuff works, I'd play around with a hack. Have some way to define a macro (using special comment lines) and then when it goes to compile the program, drop in the code in it's place. Unfortunately, I know nothing about working with Japbe plugins

Posted: Sun Apr 03, 2005 4:52 am
by Dreglor
isn't macros like c++ inline?
maybe pb should implment something like that
Posted: Sun Apr 03, 2005 9:55 am
by Psychophanta
Froggerprogger wrote:- you shouldn't use 'test' as a name for the macro, because TEST is a keyword in FASM
Code: Select all
!macro bla
!{
MessageRequester("test","hello")
!}
!bla
!bla
Hey. From Fasm preprocessor doc:
You can also "overload" instruction with macro, because preprocessor doesnt' know about instructions, it allows macro name to be instruction mnemonics.
macro pusha
{
push eax ebx ecx edx ebp esi edi
}
macro popa
{
pop edi esi ebp edx ecx ebx eax
}

Posted: Sun Apr 03, 2005 1:50 pm
by traumatic
Dreglor wrote:isn't macros like c++ inline?
Well, sort of. AFAIK 'inline' is processed by the compiler while macros are
handled by the preprocessor. Inline supports typechecking for arguments,
macros are only literally copied into the caller's location.
In nowadays programming, inlined functions are considered better, there're
still some cases 'inline' won't help.
Posted: Sun Apr 17, 2005 3:44 am
by waffle
I ran into a minor problem ...
If you declare a macro in an external include file,
You will get an error that the symbol is already defined.
I was hoping to place all my debugging code ...
compilerif #TestMode
if tracemode
calldebugger
endif
compilerendif
as a macro instead of a procedure in an include file.
Oh, I'm using PB3.91
It would help in making code more readable.
I really like this in procedures that return a value because I can ...
!CheckTestMode
Debug Reply
procedurereturn reply
endprocedure
That way, I can press the continue button and the debugger will
pause at the procedure end so I can read the return value.
Oh, it works fine in the main file, just not when the macro is defined
in the include.
UPDATE:
in the includefile, the macro was used inside a procedure ...
when removed from the procedure, everything worked ... Odd
