News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

CALL vs INVOKE

Started by Robert Collins, December 31, 2004, 02:29:56 AM

Previous topic - Next topic

roticv

It will make your code less verstile as you are forced to do something. Anyway xchg reg, mem is slow if I am not wrong.What is wrong with retn 4*noofparameters?

raymond

Gabor

I strongly believe in the KISS principle. There may be another zillion ways to do the same thing in assembler. However, whenever you complicate things for no obvious reason, you are simply asking for trouble later on.

BTW, you did mess up the EBP indexing. Remember that the stack address is decremented when you push. Therefore, your pushed parameters are at a higher address.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Randall Hyde

Quote from: Ratch on January 01, 2005, 11:01:16 PM

Quote
A macro is defined as a composite of other instructions that as a whole make up the operation of the desired results of the macro.

Sounds like a definition of a code snippet.  In MASM at least, you don't have a MACRO until it is wrapped in a MACRO-ENDM envelope.


Unless, of course, it's buried in a "text equate".
Cheers,
Randy Hyde

Robert Collins

Quote from: Ratch on January 01, 2005, 11:01:16 PM

Quote
A macro is defined as a composite of other instructions that as a whole make up the operation of the desired results of the macro.

Sounds like a definition of a code snippet.  In MASM at least, you don't have a MACRO until it is wrapped in a MACRO-ENDM envelope.

That is exactly what a macro is. How a macro is defined is language dependant. Did you know that MASM means Macro Assembler and they are not talking about macros that are user defined but rather the assembly language itself. What you and I see as assembly instructions are 'macros' (maybe not as macros in the same sense that we see macros embedded between the MACRO and ENDM statements) to the lower level 'micro-code' that does the instruction fetching which is built into the chip. Actually, assembly op-codes are really more of an 'index' to a lower level subroutine of micro code instructions which carry out the operation of the named instruction.

raymond

QuoteDid you know that MASM means Macro Assembler and they are not talking about macros that are user defined but rather the assembly language itself.

I do agree with you that the first "M" stands for "Macro". However, FYI, prior to "MASM" being issued, MS had issued its ASM assembler which had the same set of instructions and mnemonics as MASM but without the feature for user-defined macros which had not yet been developed.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Robert Collins

Quote from: raymond on March 23, 2005, 02:42:50 AM
QuoteDid you know that MASM means Macro Assembler and they are not talking about macros that are user defined but rather the assembly language itself.

I do agree with you that the first "M" stands for "Macro". However, FYI, prior to "MASM" being issued, MS had issued its ASM assembler which had the same set of instructions and mnemonics as MASM but without the feature for user-defined macros which had not yet been developed.

Raymond


Well that definitely makes sense to me so I went back and researched the books I have and I must concede that you are correct about 'M'asm. It does refer to the fact that using MASM you can now assemble user defined macros. My bad.

raymond

QuoteMy bad.

I can't take much credit for my comment because that fact was part of my era. By acknowledging that small inconsequential mistake on your part, you may now heed my signature on more important details in the future. :U :wink

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Bieb

Ah, now I understand what that means...