flat assembler
Message board for the users of flat assembler.

Index > Main > jmp/calc/ret macro

Author
Thread Post new topic Reply to topic
lovefasm



Joined: 17 Jun 2007
Posts: 22
lovefasm
Code:
macro jmp Go
{
      push    Go
  ret
}

macro call Proc
{
      push    @f
  jmp     Proc
@@:
}

macro ret AddEspNum
{
if ~ AddEspNum eq
 if      (AddEspNum mod 4)<>0
          .err
        end if
      lea     esp, [esp+(AddEspNum+4)]
    jmp     dword [esp-(AddEspNum+4)]
else
   sub     esp, -4
     jmp     dword [esp-4]
end if
}    


[EDIT by Loco]:I added the code tags. The identation already was there but for some reason it does not gets displayed without the code tags Confused[/EDIT]
Post 06 Nov 2007, 14:32
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
code tags, code tags!!
Post 06 Nov 2007, 14:36
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2917
Location: [RSP+8*5]
bitRAKE
As convention it is not a good idea to access [esp-anything], but it appears the goal here is obsfucation? ...avoid CALL instruction?
Post 06 Nov 2007, 21:40
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
funny, call with jump, jump with ret
and to ret, what do you use? a call?

result of the call is a push, push, ret
Post 15 Nov 2007, 23:06
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
what is purpose of this?
Post 15 Nov 2007, 23:37
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.