flat assembler
Message board for the users of flat assembler.

Index > Main > nasm => fasm. need some hints

Author
Thread Post new topic Reply to topic
peter müller



Joined: 18 Feb 2004
Posts: 4
Location: LE / Germany
peter müller
Hi,

i want to convert some asm sources from nasm to fasm.

first one:
%assign i 9
%rep 10
movq mm0, [esp + st_struc.s_ab + i * 16]
movq mm1, [esp + st_struc.s_ab + i * 16 + 8]
movq [esp + st_struc.s_ab + (i + 4) * 16], mm0
movq [esp + st_struc.s_ab + (i + 4) * 16 + 8], mm1
%assign i i - 1
%endrep

second one:
how to declare jump labels inside of macros
nasm use %%label:

third one:
how to define a procedure.
i tried to use: proc MyFunction
is proc a macro? when yes where is it defined ?

by peter
Post 18 Feb 2004, 20:37
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Hi!
I may be wrong, as I don't have any experience using NASM; anyway you should read FASM manual (at least chapter about macroinstructions), and everything will become clearer Very Happy
first one (see section 2.2.1 of FASM Manual):
Code:
i=9
repeat 10
movq mm0, [esp + st_struc.s_ab + i * 16] 
movq mm1, [esp + st_struc.s_ab + i * 16 + 8] 
movq [esp + st_struc.s_ab + (i + 4) * 16], mm0 
movq [esp + st_struc.s_ab + (i + 4) * 16 + 8], mm1 
i=i-1
end repeat    

second one (see section 2.3.3 of FASM Manual):
Code:
local my_label    

third one:
yes, proc is a macro (decalred in stdcall.inc file); To see how it works, you can refer to FASM win32 package examples.

reagards
Post 18 Feb 2004, 21:03
View user's profile Send private message Visit poster's website Reply with quote
peter müller



Joined: 18 Feb 2004
Posts: 4
Location: LE / Germany
peter müller
Hi,

thanx for your help. yepp i found it in the manual. maybe it was to late yesterday.
but. i can't found 'stdcall.inc'. i'm running on linux. i've downloaded the windows
package of fasm. but no 'stdcall.inc' inside. where is the file and are the macros
useable on linux ?

with best regards
peter
Post 19 Feb 2004, 09:14
View user's profile Send private message Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy
Done in a simpler way (untested, but should work):
Code:
repeat 10 
  movq mm0,[esp+st_struc.s_ab+(10-%)*16] 
  movq mm1,[esp+st_struc.s_ab+(10-%)*16+8] 
  movq [esp+st_struc.s_ab+((10-%)+4)*16],mm0 
  movq [esp+st_struc.s_ab+((10-%)+4)*16+8],mm1 
end repeat    
Post 19 Feb 2004, 09:52
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
peter müller wrote:
windows package of fasm. but no 'stdcall.inc' inside. where is the file and are the macros useable on linux ?


Actually you need GUI version for windows - FASMW. File: "include/macro/stdcall.inc".

Regards
Post 19 Feb 2004, 10:05
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
gorshing



Joined: 27 Jul 2003
Posts: 72
Location: Okla, US
gorshing
I'm not on my linux box, but I believe that it is the examples directory

_________________
gorshing
Post 19 Feb 2004, 17:20
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.