flat assembler
Message board for the users of flat assembler.

Index > Main > FASM equivalent of MASM

Author
Thread Post new topic Reply to topic
prino



Joined: 24 Jun 2004
Posts: 17
prino
Can anyone tell me what the FASM equivalent of the following MASM code is:

Code:
    .686
    .model flat
    .code
public ?RDTSC

?RDTSC    proc
    rdtsc
    ret
?RDTSC    endp
end    

Assemble using 'ml -c -coff file.asm'.

_________________
Robert AH Prins
robert dot ah dot prins at the big account from Google Wink
Post 09 Jun 2010, 21:52
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
Code:
format coff
public ?RDTSC  ;don't know if public is a valid fasm directive...
?RDTSC:          
       rdtsc
       ret
    

i think it is that.. am i right?

[edit]

i shut my mouth and just write, ... I don't know.
Post 09 Jun 2010, 22:02
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Strictly speaking, the "PROCD" in MASM by default also generates the stack frame (push ebp / mov ebp, esp), which isn't present in edfed's example. But it's not needed here.
Post 10 Jun 2010, 15:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
ok!
then, if i understand:
Code:
proc:
     push ebp
     mov ebp,esp
     ...
     pop ebp
     ret
    
Post 10 Jun 2010, 15:19
View user's profile Send private message Visit poster's website Reply with quote
prino



Joined: 24 Jun 2004
Posts: 17
prino
It worked, thanks!
Post 10 Jun 2010, 15:39
View user's profile Send private message Visit poster's website Reply with quote
ass0



Joined: 31 Dec 2008
Posts: 521
Location: ( . Y . )
ass0
Code:
proc:
push ebp
mov ebp,esp
...
mov esp,ebp ; =D
pop ebp
ret    

_________________
Image
Nombre: Aquiles Castro.
Location2: about:robots
Post 10 Jun 2010, 19:51
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
ass0,

How about leave? Wink
Post 10 Jun 2010, 20:02
View user's profile Send private message Reply with quote
ass0



Joined: 31 Dec 2008
Posts: 521
Location: ( . Y . )
ass0
enter 0,0 ==
push ebp
mov ebp,esp

leave ==
mov esp,ebp
pop ebp

_________________
Image
Nombre: Aquiles Castro.
Location2: about:robots
Post 10 Jun 2010, 20:54
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth
Masm won't generate a stack frame if there are no parameters or locals - unless you force it by adding the FORCEFRAME attribute to PROC.
Post 11 Jun 2010, 04:34
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.

Powered by rwasa.