flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > fasmx - operating system independent HLL macros

Author
Thread Post new topic Reply to topic
Mike Gonta



Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
Here is a custom HL macro collection which merges all the win32***.inc files into one.
Some features are:
    call mnemonic overloaded to replace stdcall
      Code:
      call proc_name
      call proc_name, parameter, parameter    
      Note: absolute references must use DWORD qualifier
      Code:
      call DWORD 50000h
      call DWORD [DWORD 50000h]    
      Or use an equ
      Code:
      the_proc equ 50000h
      call the_proc
      call DWORD [the_proc]    
    redefined stdcall, invoke, cinvoke and ccall to use call
      cinvoke can be replaced with invoke by first prototyping the proc name
      Code:
      proc_name@=1    
      ccall can be replaced with call by using the c keyword in the proc macro or by first prototyping the proc name

    proc macro uses keyword extended with flags keyword to return flags
      Code:
      proc proc_name uses flags <register list>, parameters    
      saves the eflags and clears the carry, zero and sign bits in the stacked copy (this is the default returned)

    proc macro ret modified to additionally return an optional value in eax
      Code:
      ret
      ret esi
      ret 0
      ret [variable]    
      retc, retz and rets sets either the carry, zero or sign bit as well as returning an optional value in eax
      Code:
      retc esi
      retz 0
      rets [variable]    
    modified allowed_nesting macro pushd macro where a subroutine is used as a parameter eax is first saved
    modified pushd macro where strings are inlined replaced call with jump/push
    added code keyword to push ascii code of one to four characters in string directly instead of pointer to string
    modified pushd macro where addr keyword needs effective address of parameter eax used instead of edx and is first saved
    defined all as ebx ecx edx esi edi to replace use of pusha, this accounts for eax being returned, ebp as frame pointer and redundant esp
    Code:
    proc proc_name uses flags all, parameter, parameter    

bin32.inc is included in the following:
    win32a.inc ; similar to win32a.inc - ascii character, extended proc features, parameter count checking with warning only assembly continues
    win32ax.inc ; similar to win32ax.inc - ascii character, extended proc features, parameter count checking with warning only assembly continues
    win32axp.inc ; similar to win32axp.inc - ascii character, extended proc features, parameter count checking with halt on error
    win32w.inc ; similar to win32w.inc - wide character, extended proc features, parameter count checking with warning only assembly continues
    win32wx.inc ; similar to win32wx.inc - wide character, extended proc features, parameter count checking with warning only assembly continues
    win32wxp.inc ; similar to win32wxp.inc - wide character, extended proc features, parameter count checking with halt on error
.


Last edited by Mike Gonta on 03 Jul 2013, 00:53; edited 13 times in total
Post 25 Dec 2011, 16:53
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
I see, the new mbr_tsr except this one is 32 bit.

Dude, FASM is fine as is IMO. I hope your extensions don't add bloat to programs with the HL implementation codes you are adding.
Post 25 Dec 2011, 18:06
View user's profile Send private message 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-2019, Tomasz Grysztar.

Powered by rwasa.