Re: Apologies seem to hurt



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
.



Relevant Pages

  • Re: Apologies seem to hurt
    ... directive, not a MACRO. ... all the functionality of the INVOKE directive with MASM. ... Not built in MACROs, directives. ...
    (alt.lang.asm)
  • Re: Apologies seem to hurt
    ... Are we talking MASM here? ... INVOKE does. ... I have written a MACRO called INVOKIT that PUSHes ... Not built in MACROs, directives. ...
    (alt.lang.asm)
  • Re: Missing documentation for HAVE_FOOBAR definitions
    ... <snip HAVE_FOO def'n list> ... this macro checked whether `setvbuf' takes ... appears in the autoconf documentation, ... looking for to see #define or #undef directives? ...
    (comp.os.linux.development.apps)
  • Re: Preprocessing directive in the middle of macro arguments
    ... this compiler seems confused by any preprocessing ... conditionaly select one of several arguments passed to a macro. ... All preprocessor directives are processed before any macro expansion ... need to skip to #endif ...
    (comp.lang.c)
  • Re: The textbook ASSEMBLERS AND LOADERS...
    ... macro) or to one or more statements " ... There is clearly a *HUGE* difference between macros and directives so ... contray to your ignorant claim that "macros, directives, and statements are all ... you are full of shit. ...
    (alt.lang.asm)