flat assembler
Message board for the users of flat assembler.

Index > Windows > Running programs

Author
Thread Post new topic Reply to topic
kazsemisonic



Joined: 22 Aug 2005
Posts: 3
kazsemisonic
Hey everybody,
I'm just starting to learn assembly and got the fasm compiler. Whenever I run my programs nothing happens (I think a dos prompt is just popping up and back down really quickly). So I think if i run it from command prompt I will be able to see the output. Does anybody know how to do this? I'm not having much luck. Thanks

-Kaz

EDIT: I compiled it, so now it's a .bin. But from what I've read in a tutorial, I still need to "link" it to get the .exe. Does fasm come with a linker? If it does, then how do you link it? Thanks for the help.

btw, here's the code:

Code:
MOV AH,02
MOV DL,"!"
INT 21h
MOV AH,04Ch
MOV AL,00
INT 21h  
    
Post 22 Aug 2005, 16:36
View user's profile Send private message Reply with quote
polygon7



Joined: 14 Aug 2003
Posts: 62
Location: Poznan, Poland
polygon7
Hi,
add "format MZ" at begin of your source file:
Code:
format MZ
MOV AH,02
MOV DL,"!"
INT 21h
MOV AH,04Ch
MOV AL,00
INT 21h  
    
btw. look in fasm/examples directory Smile

_________________
best regards
p7
Post 22 Aug 2005, 20:10
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
click start->run and type "command" (or "cmd" under XP). It opens DOS console, let me know with further problems.
btw: "format MZ" means you want to produce .EXE file, you can also use "org 100h" to produce .COM which is more natural solution in this case
Post 22 Aug 2005, 20:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
kazsemisonic



Joined: 22 Aug 2005
Posts: 3
kazsemisonic
Thanks, I stuck the "org 100h" in there and it made the .com. Just wondering, when I run it my screen blinks and the program is up, why does it do that? Thanks again.

- Kaz
Post 23 Aug 2005, 01:21
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
hmm, what do you mean by "program is up?" are you running it under windoze's console or how?
Post 23 Aug 2005, 10:36
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Because when it finishes - it has nothing to do and exits. You have to either put "pause" in the end or infinite loop. Alternatively you can use the command/cmd suggestion made few posts before.
I usually make some a.bat file that has "cmd" ("command" on Win9x) written in it. When opening it in the same directory as your .com file is you can just type the file's name. You can see that it finishes immediately giving you back your blinking (or not Confused) cursor like this:
Code:
C:\WINDOWS\Desktop>command


Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999.

C:\WINDOWS\Desktop>hello
Hello, World!
C:\WINDOWS\Desktop>_
    

-OR-
Code:

C:\Documents and Settings\User\Desktop>cmd
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\Documents and Settings\User\Desktop>hello
Hello, World!
C:\DOCUME~1\User\Desktop>_
    
Post 23 Aug 2005, 10:39
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
kazsemisonic



Joined: 22 Aug 2005
Posts: 3
kazsemisonic
I got it all figured out now. I can't remember what I did for it to act like that, but I thing I was executing the program from the directory it was in. The screen would go black and then come back up with a new ms-dos console open (not the regular one, but with the file - edit stuff at the top) and the program running in it. Thanks for the help, now it's off to learn some more assembly....
Post 23 Aug 2005, 15:32
View user's profile Send private message 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 GitHub, YouTube, Twitter.

Website powered by rwasa.