flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Have fasm a macrofunction?

Author
Thread Post new topic Reply to topic
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent
It interesting for me.

MASM is have "macroprocedures" and "macrofunctions".
It is very important.

For example, I can use this (macroprocedure), I may convert it for FASM:

Code:
MAKELANGID macro reg,s,p:REQ
   mov   reg,(p shl 10) or s
MAKELANGID endm

MAKELANGID eax,LANG_ENGLISH,SUBLANG_DEFAULT
    


but how can I use this at FASM:

Code:
$MAKELANGID macro s,p:REQ
   exitm (p shl 10) or s
$MAKELANGID endm

mov   eax,$MAKELANGID
    


Question
Post 07 Feb 2004, 11:03
View user's profile Send private message Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 492
Location: Norway
Tommy
Something like this?
Code:
macro MAKELANGID s,p {
  dd (p shl 10) or s
}

macro mov_ op1,op2 {
  local temp_pos,x
  virtual at 0
    temp_pos: op2
    load x dword from temp_pos
  end virtual
  mov op1,x
}

use32
mov_ eax,<MAKELANGID 2,5>
    
Post 07 Feb 2004, 12:04
View user's profile Send private message Visit poster's website Reply with quote
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent
Hm…

It is better than I done.
Thank you very much!
Post 07 Feb 2004, 12:49
View user's profile Send private message Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 492
Location: Norway
Tommy
You're welcome! Wink It was fun to play around with it... Very Happy
Post 07 Feb 2004, 20:05
View user's profile Send private message Visit poster's website 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.