flat assembler
Message board for the users of flat assembler.

flat assembler > Main > Is there a lot of syntax difference between masm32 and fasm

Author
Thread Post new topic Reply to topic
Tortoise39



Joined: 26 Apr 2019
Posts: 3
I am new to assembly

Can i copy paste this code in fasm assembler and make it work ?

Code:
include \masm32\include\masm32rt.inc

.data?                  ;This contains uninitialized variables
somevar dd ?

.data                    ;This contains initialized variables
txHello db "Hello World", 0

.code                    ;This is where your code resides
start:
  inkey offset txHello
  exit
end start    
Post 26 Apr 2019, 12:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16707
Location: In your JS exploiting you and your system
For some background about the differences these topics might help.

https://board.flatassembler.net/topic.php?t=7572
https://board.flatassembler.net/topic.php?t=9998
https://board.flatassembler.net/topic.php?t=13867
https://board.flatassembler.net/topic.php?t=16215

But I recommend you look at the \examples\* folder in the fasm download zip for how fasm does things. You can use a fasm example as the base and develop your code from there. That would be easier than trying to convert from masm code. Unless, that is, you have to convert because your current code base is in masm.
Post 26 Apr 2019, 13:03
View user's profile Send private message Visit poster's website Reply with quote
Tortoise39



Joined: 26 Apr 2019
Posts: 3
Thanks for the reply revolution ,

I looked at the example folder and only saw a window based assembly language example .

I am looking for a simple console based hello world program

Can someone help ?
Post 26 Apr 2019, 13:17
View user's profile Send private message Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 578
Location: /96A
as for Windows® assembly programming, fasm package misses a lot of examples
(Tomasz still doesn't understand that examples are to teach, not to advertize)

yet look at sources for fasmw.exe, fasm.exe, fasmd.exe
(try also Tomasz's programming videos)

you revolution could also search through the board and create one package of fine examples herein
(or at least make possible to download from one folder all related archives)
Post 26 Apr 2019, 14:25
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 353
Location: Russian Federation, Sochi
Examples for fasm mostly exist standalone out of fasm package.
And yes. Almost all masm32 package examples had translated to fasm syntax. somewhere like wasm.ru (its archive), (or site of forum member avcaballero), etc . Moreover fasm examples for win64 are much more numerous then masm ones.

search on forum history these packages:
FASMW64_4-22-2013.zip (very recomend, as avcaballero site and as wasm.ru archives)
fasmpak-win32.zip
and in fasmgwin.zip (these examples for fasmg specially fully compatibable with fasm)

EasyCode with same named multyassembler IDE, it has rich includes for fasm syntax too.

There are(in internet) patches and mods for games in fasm assembler syntax (homm MoP for example), but there are much more.

About couple of thousand programs(big & small) for windows exist in fasm are over Internet.

So windows supported with fasm examples very well.
Minus of all of them - they all are small and simple or big and complex (like fasm) without intermediate stage.
Post 26 Apr 2019, 20:02
View user's profile Send private message Send e-mail Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 222
its kinda weird, that people call masm as an assembler.

_________________
Asm For Wise Humans
Post 27 Apr 2019, 03:35
View user's profile Send private message Reply with quote
Tortoise39



Joined: 26 Apr 2019
Posts: 3
Thanks for all the replies ,

I guess the right thing for me to do is to stay with MASM32 , because even though little by little i have been trying to learn that for more than a year now .

I was beginning to like the FASM assembler too

But there is clearly a lack of examples for new people
Post 27 Apr 2019, 06:37
View user's profile Send private message Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 222
i think to understand fasm you need to understand how simple and flexible it is, i dont know what kind of person you are but if you are one of those who are able to learn from reading and practising then all you need is read docs from flat assembler's website as well as examples shipped with fasm.

im currently logged in using my phone, otherwise i would write some code samples or something more useful.

if you are still interested, please let me know and tell me what subsystem you often program for.

_________________
Asm For Wise Humans
Post 27 Apr 2019, 14:43
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
Tortoise39 wrote:
Thanks for all the replies ,

I guess the right thing for me to do is to stay with MASM32 , because even though little by little i have been trying to learn that for more than a year now .

I was beginning to like the FASM assembler too

But there is clearly a lack of examples for new people


Try buying / reading Mastering Assembly Programming (Alexey Lyashko). It uses FASM, and Tomasz helped edit it a bit or whatever (see Main's A new book).

EDIT: Just to give yet another (non-FASM) suggestion, check out Ray Seyfarth's book(s) here. It sounds promising, at least, but I guess it depends on what you're trying to learn or do.
Post 28 Apr 2019, 04:11
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.