flat assembler
Message board for the users of flat assembler.

flat assembler > Macroinstructions > org without virtual

Author
Thread Post new topic Reply to topic
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
Hi all again.
I'm writing macroses for fasm, but i have new problem Smile it's org or something like this.

I have this macroses:
Code:
macro MAKELANGID s,p { dd (p shl 10) or s } 

macro        push    op1
{
       if      <op1> eqtype <0> | <op1> eqtype <eax> | <op1> eqtype <[]>
               push    op1
 else 
               local   t,x
         virtual at 0
                        t: op1
                  load x dword from t
         end virtual
         push    x
   end if
}
    


this all for implementing calls like this
call MyFunk, <MAKELANGID 1,2>

but! I need to implement this without _virtual_, can i do it?
on masm i can do like this:
Code:
 push 0
      org $-4
     dd op1
    

but org directive on fasm works else Sad

anybody can help me? fasm is powerful and i know, what it's possible, but i do not how Sad

it's not critical, but it for more usable and readable code, and for more easy portabling C++ headers...

when i will finish this work i will give for all my new includes for WinAPI...

P.S.
I can't use macro like this:
Code:
      __stdcall equ
macro  __stdcall name,arg
{
        eqtype.#name = 1
    if used name
        extrn '__imp__'#`name#'@'#`arg as name:dword
        end if
}

macro   DECLSPEC_IMPORT [name]
{
common
  if      _#name eq ___stdcall name
           name
        else
        'error: invalid declaration type',13
  end if
}

DECLSPEC_IMPORT __stdcall MessageBoxA,16

    

because macroses like MAKELANGID can be more than 100...

thanks.
Post 15 May 2004, 14:36
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7318
Location: Kraków, Poland
You can do such things also this way:
Code:
        push dword 0
        store dword op1 at $-4    

but why do you need it without a "virtual"?
Post 15 May 2004, 16:26
View user's profile Send private message Visit poster's website Reply with quote
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
Sorry, sure store. RTFM Smile

Thanks...
Post 17 May 2004, 15:47
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
but why do you need it without a "virtual"?

because when i use proc and local variables, and i use new virtual they overlapped and i can't use local variables...

Code:
proc MyProc
.var1 dd ?
    enter
    call Function1, <MAKELANGID 1,2>
    mov eax,[.var1]                        ;error!
    
Post 17 May 2004, 17:19
View user's profile Send private message Visit poster's website 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-2019, Tomasz Grysztar.

Powered by rwasa.