something on Assembly language (for beginners)

The different procedure calling convention.
STDCALL
Parameters are pushed to stack using right to left order.
Parameters pushed to stack are removed by the called procedure itself.

C ALL
Parameters are pushed to stack using right to left order.
Parameters pushed to stack are removed by the calling program.

PASCAL CALL
Parameters are pushed to stack using left to right order.
Parameters pushed to stack are removed by the called procedure itself.


Declaring Procedure Prototypes
MASM provides the INVOKE directive to handle many of the details important to procedure calls, such as pushing parameters according to the correct calling conventions. To use INVOKE, the procedure called must have been declared previously with a PROC statement, an EXTERNDEF (or EXTERN) statement, or a TYPEDEF. You can also place a prototype defined with PROTO before the INVOKE if the procedure type does not appear before the INVOKE. Procedure prototypes defined with PROTO inform the assembler of types and numbers of arguments so the assembler can check for errors and provide automatic conversions when INVOKE calls the procedure.

does it ring a bell on C prototype and forward declaration? :)

How to make a choice between a Macro and procedure?

Macros are processed by preprocessor, rather than the compiler. Macro invocations are replaced with the macro repetitively. It appears in the listing repetitively.

Procedures involves CALL and RET, and it appears only once in the listing;

So as a result, Macros has a larger size of compiled code, while Procedures has some overhead with CALL and RET, and thus a slower execution speed.