heya, here is my macro for a nice custom pushes in your app



PUSHR MACRO REG1,REG2,REG3,REG4,REG5,REG6,REG7,REG8,REG9,REG10,REG11,REG12
FLAG=0
IRP R,<EAX,EBX,ECX,EDX,CS,DS,ES,ESI,EDI,SS,EBP,ESP>
IRP REGX,<REG1,REG2,REG3,REG4,REG5,REG6,REG7,REG8,REG9,REG10,REG11,REG12>
IFNB <REGX>
IFIDN <R>,<REGX>
PUSH REGX
FLAG=1
ENDIF
ELSE
EXITM
ENDIF
ENDM
ENDM

IF FLAG EQ 0
PUSHF
PUSH EAX
PUSH EBX
PUSH ECX
PUSH EDX
PUSH CS
PUSH DS
PUSH ES
PUSH ESI
PUSH EDI
PUSH SS
PUSH EBP
PUSH ESP
ENDIF

ENDM


you can call it like this:
PUSHR ; push all the regs
PUSHR EAX,ECX,EDX ; pushes those 3 only to stack
PUSHR EDX ; push only parameter to stack

i didn't do any POP macro as it is the same as the macro above only diff keywords =)

knows bugs:
PUSHR EAX,EDX,,EDX ; won't push EDX, only EAX,EDX, this is cuz i use exitm, remove it and it will work :)
mabye someone will fix it up to be even more powerfull and use it
:)
Posted on 2003-06-03 01:22:34 by wizzra
In 99,99% cases we do not need care about segment regs.

PUSHR MACRO regs:VARARG

local reg
IFNB <regs>
FOR reg, <regs>
push reg
ENDM
ELSE
pushfd
pushad
ENDIF
ENDM
Posted on 2003-06-09 04:29:45 by Four-F
This has served me well. Ratch

; **********************************

PUSHIT MACRO args:VARARG ; Push onto stack in listed order
FOR arg,<args>
PUSH arg
ENDM
ENDM
; ***************************************
RPUSHIT MACRO args:VARARG ; Push onto stack in reverse order
%PUSHIT @ArgRev(args)
ENDM
; ************************************
Posted on 2003-06-09 09:40:32 by Ratch