Re: Apologies seem to hurt
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Sat, 08 Sep 2007 02:55:39 GMT
Ratch wrote:
"Frank Kotler" <fbkotler@xxxxxxxxxxx> wrote in message news:zShEi.10$jn3.6@xxxxxxxxxxx
Ratch wrote:
Sorry for interrupting and being pedantic, but INVOKE is a directive, not a MACRO. You cannot not duplicate all the functionality of INVOKE with MACRO build statements no matter how skillful you are at writing MACROs, or how hard you try.
Are you sure of this? I'm not a very skillful macro-slinger (bad mac-fu), but I believe that one *can* duplicate all of the functionallity of Masm's "proc" and "invoke" with, say, Nasm's macro system. What is it you think we can't do?
I don't know anything about NASM. But I don't think you can duplicate all the functionality of the INVOKE directive with MASM.
Okay.
If you look in the MASM Programmer's Guide, you will see a statement in Chapter 7 referring to INVOKE as a "directive that automates parameter passing".
Ordinarily (in my understanding), a "directive" doesn't generate code, but instructs the assembler how to generate other code. A "directive that generates code" sure smells like a "macro" to me!
MS calls INVOKE a directive in their programmer's guide. It can do things in MASM that you cannot duplicate with MASM MACRO statements.
Okay.
Randy informs me that "stdout.put" is a macro, but that "stdout.puts" is not, it's a "procedure call". Ooookay...
So? What is the point?
That, if it generates code we didn't write, it "quacks like a macro", regardless what MS or Randy call it.
Whatever name we call it, a "directive that generates code" is a different critter than an "ordinary directive" like "bits 16" (or "assume") which does not.
You need to read the programmers manual. DWORD, BYTE,WORD, etc are all directives that generate code.
Oh, my!!! Masm's more of a "compiler" than I realized! What code do they generate?
Only a directive with access to the internals of MASM can do all that INVOKE does. Especially the way it interacts with the PROC directive. For what its worth, I have written a MACRO called INVOKIT that PUSHes parameters in reverse
Which is "reverse" depends on the ".model" directive, no?
No.
So if I do ".model large pascal" or ".model large stdcall" I get the parameters pushed in the same order when I do "invoke"? Good for Masm!
onto the stack and then CALLs a subroutine. I find it comes in handy.
Absolutely! But your assertion that you can't do "INVOKE" with macros supports Betov's claim that Masm *can't* do it with macros,
Betov is right if he claims you cannot code the directive INVOKE with MACRO statements that cover the full functionality of INVOKE . That includes interaction with PROC and PROTO. But so what? The directive INVOKE is available in MASM.
Okay. I seem to recall that Randy proved to Betov that you *can* do the same thing as "invoke" with Masm's macros, but perhaps my memory fails me. I know Betov doesn't remember it!
and *has* to use "built-in macros". Could be true, but I don't think so...
Not built in MACROs, directives.
Quack, Quack!
Best,
Frank
.
- Follow-Ups:
- Re: Apologies seem to hurt
- From: Ratch
- Re: Apologies seem to hurt
- References:
- Apologies seem to hurt
- From: Betov
- Re: Apologies seem to hurt
- From: //\\\\o//\\\\annabee
- Re: Apologies seem to hurt
- From: Betov
- Re: Apologies seem to hurt
- From: JDavison
- Re: Apologies seem to hurt
- From: Betov
- Re: Apologies seem to hurt
- From: JDavison
- Re: Apologies seem to hurt
- From: Betov
- Re: Apologies seem to hurt
- From: JDavison
- Re: Apologies seem to hurt
- From: //\\\\o//\\\\annabee
- Re: Apologies seem to hurt
- From: JDavison
- Re: Apologies seem to hurt
- From: //\\\\o//\\\\annabee
- Re: Apologies seem to hurt
- From: JDavison
- Re: Apologies seem to hurt
- From: //\\\\o//\\\\annabee
- Re: Apologies seem to hurt
- From: JDavison
- Re: Apologies seem to hurt
- From: highdoe
- Re: Apologies seem to hurt
- From: Herbert Kleebauer
- Re: Apologies seem to hurt
- From: Ratch
- Re: Apologies seem to hurt
- From: Frank Kotler
- Re: Apologies seem to hurt
- From: Ratch
- Apologies seem to hurt
- Prev by Date: Re: Apologies seem to hurt
- Next by Date: Re: simple 47 bits newbe ;_0
- Previous by thread: Re: Apologies seem to hurt
- Next by thread: Re: Apologies seem to hurt
- Index(es):
Relevant Pages
|