flat assembler
Message board for the users of flat assembler.

Index > Main > New to FASM. Which IDE? MZ EXE Hello World issues

Author
Thread Post new topic Reply to topic
jayanthd



Joined: 02 Mar 2013
Posts: 3
Location: India
jayanthd 02 Mar 2013, 07:19
Hello!

I am new to FASM. I have installed FASM but it lacks an IDE. I want to know which IDE I can use with FASM. It will be helpful if somebody gives a simple "Hello! FASM" asm example.

_________________
Thanks and Regards
Jayanth D
Post 02 Mar 2013, 07:19
View user's profile Send private message Send e-mail Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1308
Location: Paradise Falls
Picnic 02 Mar 2013, 08:13
Hi jayanthd,

Fresh, x64lab, Winasm Studio, RadASM and of course FASMW, the default ide.


There is a Windows "Hello World" sample in the "examples" folder.

DOS 16-bit COM.
DOS 16-bit EXE.
Windows 32-bit example.

Have fun.
Post 02 Mar 2013, 08:13
View user's profile Send private message Reply with quote
jayanthd



Joined: 02 Mar 2013
Posts: 3
Location: India
jayanthd 02 Mar 2013, 09:49
Hi Picnic

I don't understand this code
Code:
; fasm example of writing simple EXE program 

format MZ 

        push    cs 
        pop     ds 
        mov     ah,9 
        mov     dx,hello 
        int     21h 

        mov     ax,4C00h 
        int     21h 

hello db 'Hello world!',24h   
    


In first line
Code:
format MZ     
tells it is an exe file. Right?
Why push cs and then pop ds?
Why mov, dx, hello and not mov dx, offset hello?

_________________
Thanks and Regards
Jayanth D
Post 02 Mar 2013, 09:49
View user's profile Send private message Send e-mail Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1308
Location: Paradise Falls
Picnic 02 Mar 2013, 10:26
Right.
The specific example uses the same segment for both data and code. In MZ format you have to proper initialize DS.
It's the same. Fasm doesn't use the "offset" "ptr" directives.

Fasm documentation: http://flatassembler.net/docs.php


Last edited by Picnic on 02 Mar 2013, 11:00; edited 1 time in total
Post 02 Mar 2013, 10:26
View user's profile Send private message Reply with quote
jayanthd



Joined: 02 Mar 2013
Posts: 3
Location: India
jayanthd 02 Mar 2013, 10:59
Picnic wrote:
Right.
The specific example uses the same segment for both data and code. In MZ format you have to proper initialize DS.
It's the same. Fasm doesn't need the "offset" directive.

Fasm documentation: http://flatassembler.net/docs.php


@Picnic

So, ds is used as the segment here. Right?

Can I use
Code:

mov ax, cs
mov ds, ax     
instead of
Code:
 push cs
pop ds    
?

_________________
Thanks and Regards
Jayanth D
Post 02 Mar 2013, 10:59
View user's profile Send private message Send e-mail Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1308
Location: Paradise Falls
Picnic 02 Mar 2013, 11:09
Sure you can. You can't however, as you see, move CS directly to DS.
Post 02 Mar 2013, 11:09
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1495
Location: Toronto, Canada
AsmGuru62 02 Mar 2013, 12:53
jayanthd:
You can try this IDE (I wrote it for myself):

http://board.flatassembler.net/topic.php?t=13080

Also, check out the whole "IDE Development" sub-section of this forum.
There are a lot of IDEs being discussed there.
Post 02 Mar 2013, 12:53
View user's profile Send private message Send e-mail 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-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.