flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > macro proc ... "enter" and "uses all"

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
hi all,

Small changes in PROC32.INC
a) use of "enter" opcode.
b) the possibility of declaring "uses all".

Code:
macro prologuedef procname,flag,parmbytes,localbytes,reglist
{
    local flag
  flag = 1
    if parmbytes | localbytes       
            enter localbytes , 0
        end if
      match =all,reglist
          \{
            flag = 0
            pushfd
              pushad
      \}
    if flag
             irps reg, reglist \{ push reg \}
        end if
}

AND

macro epiloguedef procname,flag,parmbytes,localbytes,reglist
{
   local flag
  flag = 1
    match =all,reglist
          \{
            flag = 0
            popad
               popfd
       \}
    if flag 
            irps reg, reglist \{ reverse pop reg \}
 end if
      if parmbytes | localbytes
              leave
    end if
      if flag and 10000b
             retn
     else
           retn parmbytes
           end if
}
    
Post 20 Jan 2009, 09:11
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
Is this ever true?
Code:
if flag and 10000b    
Post 20 Jan 2009, 09:36
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
"flag" ... yes ...
I used the symbol "flag" ... already in use.
I fixed this.
Code:
PROC32.INC

macro prologuedef procname,flag,parmbytes,localbytes,reglist
{
      local @all
  @all = FALSE
        if parmbytes | localbytes       
            enter localbytes , 0
        end if
      match =all,reglist
          \{
            @all = TRUE
                 pushfd
              pushad
      \}
    if ~ @all
                   irps reg, reglist \{ push reg \}
        end if
}

and ,

macro epiloguedef procname,flag,parmbytes,localbytes,reglist
{
 local @all
  @all = FALSE
        match =all,reglist
  \{
            @all = TRUE
         popad
               popfd
       \}
    if ~ @all
           irps reg, reglist \{ reverse pop reg \}
 end if
      if parmbytes | localbytes
           leave
       end if
      if flag and 10000b
          retn
        else
                retn parmbytes
      end if
}

    
Post 20 Jan 2009, 10:18
View user's profile Send private message Send e-mail 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.