Hi, i want to create a macro that does the folowing:

macro nop
and it will return
push 90h

macro ret
and it will return
push 0C3h

Is this possible? Thanks.
Posted on 2004-10-22 16:15:15 by x-dream
nop

retn


_NOP MACRO

push 90h
ENDM

_RET MACRO
push 0C3h
ENDM
I don't know what use they are over the instructions? :?:
Posted on 2004-10-22 17:19:15 by bitRAKE
Thanks for your reply, but i would like a more generic approach that i can enter many different opcodes.
Posted on 2004-10-23 05:35:00 by x-dream
I would not recommend it, but, if you must replace the instructions...

Use option nokeyword to tell MASM to ignore those instructions you are going to replace.
For example, bitRAKE's macro can be renamed as in the following example:


option nokeyword:<nop>
nop MACRO
push 90h
ENDM


Be careful and do not overuse this option.
Posted on 2004-10-23 05:57:19 by Starless
I would not recommend it, but, if you must replace the instructions...

Use option nokeyword to tell MASM to ignore those instructions you are going to replace.
For example, bitRAKE's macro can be renamed as in the following example:


option nokeyword:<nop>
nop MACRO
push 90h
ENDM


Be careful and do not overuse this option.


This wasnt my question...

i want it to be able to do

macro xor eax,eax
macro mov eax,ebx
macro mov esi,offset something

and it returns it in push
Posted on 2004-10-23 09:28:36 by x-dream
Use FASM as this is not possible in MASM.
Posted on 2004-10-23 11:50:47 by bitRAKE