callp
-----

There are some things you must understand about callp:

As you should know 'callp' is a macro I made to replace INVOKE and you
may freely use it (I recommend it over INVOKE greatly), it's in qlib.inc

(C programmers should not be concerned with this)

You should just know how it works so you can avoid some things:
  Features/advantages/disadvantages :
    - all args are zero extended to DWORDs (regardless of what the PROC wants)
      (hey, it's just a macro)
      (it trashing eax sometimes but you shall be warned if you try and use
       eax if it's been trashed)
    - QWORDs are pushed properly now
    - FWORDs are zero extended to QWORDs (does NOT trash eax)
    - no augment matching is performed at all (it's just a simple macro)
    - if a constant is given it is pushed as a DWORD - this is the only
      real problem if a FWORD or QWORD is expected by the proc then it will
      not get it properly (and all other args after that)
    - knows that segment registers are 32bits (unlike INVOKE which messes
      up the stack and crashes your programs)
    - properly extends args (INVOKE does not always properly extend them -
       ie : Proc expects DWORD and you pass a WORD, Masm should push a word
       0 then the WORD, but instead it pushes DWORD 0 then the WORD (stack
       messed up and program crashes))

So don't use INVOKE (it sux) and use callp.  You should never have any more
problems again... (NOTE: INVOKE only bombs like this in 32bit segments,
as far as I know in 16bit ones it works ok) (but who works in 16bit modes
anymore?)

If you don't want to use callp and want the speed that INVOKE gives
keep harasing MS until they fix INVOKE! (renaming it to CALL would be nice too)
    call 1-905-568-3503 (Toronto)
    or   1-800-759-5474 (Developers Network?)
    or   1-800-936-4300 (Automation help)  (press 5 for MASM V6.1 ??)
                               (gee isn't V6.11 out yet !!)

Here are some newer bugs found with callp:
 - callp bugs : can't use forward references
              : using signed numbers is very unpredictable
     ie: callp proc,ax
   When ax is a signed number it will always be zero extended
    to a 32bit number. (even if you ASSUME ax:sbyte)
   Just remember that everything is ZERO extended to 32bits.
   Remedy : Use C for programming, ASM programming sux for BIG projects
            or you can use INVOKE but be careful...
 - callp does not expand REAL4 into REAL8 as all other compilers do.
   I hate everything!

Please report any problems/bugs to me (concerning callp).
mailto:sub_death@geocities.com

http://www.geocities.com/SiliconValley/Peaks/1231

;CALLP Ver 1.09
; NEW ver 1.09 : Can now use 'st(0)' or 'st' as a parameter.  Callp
;                will push st(0) onto the SS:ESP stack and then pop it
;                from the FPU stack (fstp [esp]).  This may be used
;                as many times as you like on any callp macro call.
;                You must make sure the FPU stack is empty when calling
;                QLIB functions.
; NEW ver 1.08 : Now uses 'ifidni' which is not case sensitive
; NEW ver 1.07 : Fixed bug : Removed '!' from where it was not allowed to be
; NEW ver 1.06 : TBYTE (and REAL10) are now properly DWORD aligned when
;              : pushed on stack (Nov/97)
; NEW ver 1.05 : Fixed a bug in destroy_ax thingy (QLIB v2.01)
; NEW ver 1.04 : Now capable of pushing REAL 10 (QLIB v2.00 Beta#4)
; NEW ver 1.03 : Fixed a bug I added in Ver 1.02 (stupid!) (push (a3) is bad)
;              : Sept 7/96
; NEW ver 1.02 : Fixed major bug !!! if arg was offset x+4 size was == 8 ???
;              : also capable of FWORD (aug 25/96)
; NEW ver 1.01 : Now capable of pushing REAL 8 and other bugs fixed

; Known bugs : as of Nov 30/96 I've found too many bugs and now have designed
;              it garbage.  I don't know how to fix these bugs
; 1) if there is a forward reference in the varargs then MASM causes an error
; 2) callp never uses movsx which is bad!
; see callp.inc if you wanna look at it

; Too many bugs, that cannot be fixed cause MASM sux!
; Use callp on your own risk, if you know when you can't use INVOKE use this

