flat assembler
Message board for the users of flat assembler.

Index > Windows > Assembling a .asm file?

Author
Thread Post new topic Reply to topic
dogrules23



Joined: 10 Sep 2022
Posts: 6
dogrules23 10 Sep 2022, 09:08
I downloaded a file for some experimentation and the instructions say

"Download Flat Assembler
or
If you are on Linux, you may use sudo apt-get install fasm
Assemble using the following command
fasm main.asm"

I don't know how to do any of this as I'm new to all of this stuff. I don't even know if I should be running FASMW.EXE or FASM.EXE to do it. Neither way seems to do anything, so I'm just confused. Any help would be GREATLY appreciated![/quote]
Post 10 Sep 2022, 09:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18960
Location: In your JS exploiting you and your system
revolution 10 Sep 2022, 09:19
fasm.exe is for the command line. So you need to open cmd.exe and run it there.

fasmw.exe is the IDE for Windows. You can run that as a normal GUI program.

If you have problems, show the error messages and outputs, then we can see what is happening.
Post 10 Sep 2022, 09:19
View user's profile Send private message Visit poster's website Reply with quote
dogrules23



Joined: 10 Sep 2022
Posts: 6
dogrules23 10 Sep 2022, 09:22
Every time I run it in the command line version, I get the error "'fasm' is not recognized as an internal or external command,
operable program or batch file." I don't know how to get it to do anything in the IDE version, it just tells me "file not found".
Post 10 Sep 2022, 09:22
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 587
Location: Ukraine
Overclick 10 Sep 2022, 09:24
Make sure you expanded your command prompt to Fasm folder
Post 10 Sep 2022, 09:24
View user's profile Send private message Visit poster's website Reply with quote
dogrules23



Joined: 10 Sep 2022
Posts: 6
dogrules23 10 Sep 2022, 09:27
Overclick wrote:
Make sure you expanded your command prompt to Fasm folder


Ok, uhh, how do I do that exactly? Is it not just dragging in the FASM.EXE?
Post 10 Sep 2022, 09:27
View user's profile Send private message Reply with quote
dogrules23



Joined: 10 Sep 2022
Posts: 6
dogrules23 10 Sep 2022, 09:46
I figured it out, but now the error I get is:

"D:\Downloads\fasmw17330>fasm main.asm
flat assembler version 1.73.30 (1048576 kilobytes memory)
main.asm [91]:
include '\fasm\include\win32ax.inc'
error: file not found."
Post 10 Sep 2022, 09:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18960
Location: In your JS exploiting you and your system
revolution 10 Sep 2022, 10:36
Using relative paths, or a path using an environment variable, will give fewer problem.
Code:
;...
include 'include\win32ax.inc'  ; relative path, no leading slash
include '%INCLUDE%\win32ax.inc' ; use an environment variable named INCLUDE
;...    
By default fasm uses the environment variable named INCLUDE so you don't have to manually put that in the source.
Post 10 Sep 2022, 10:36
View user's profile Send private message Visit poster's website Reply with quote
dogrules23



Joined: 10 Sep 2022
Posts: 6
dogrules23 10 Sep 2022, 15:27
revolution wrote:
Using relative paths, or a path using an environment variable, will give fewer problem.
Code:
;...
include 'include\win32ax.inc'  ; relative path, no leading slash
include '%INCLUDE%\win32ax.inc' ; use an environment variable named INCLUDE
;...    
By default fasm uses the environment variable named INCLUDE so you don't have to manually put that in the source.


So I need to edit the source code to get it to work properly? Here I was thinking I just needed to run the command listed in the original instructions and it'd work. There's so much more to this than I expected.
Post 10 Sep 2022, 15:27
View user's profile Send private message Reply with quote
dogrules23



Joined: 10 Sep 2022
Posts: 6
dogrules23 10 Sep 2022, 21:43
revolution wrote:
Using relative paths, or a path using an environment variable, will give fewer problem.
Code:
;...
include 'include\win32ax.inc'  ; relative path, no leading slash
include '%INCLUDE%\win32ax.inc' ; use an environment variable named INCLUDE
;...    
By default fasm uses the environment variable named INCLUDE so you don't have to manually put that in the source.


No matter which line is in the source code I downloaded, I still get an error saying win32ax.inc cannot be found or doesn't exist.
Post 10 Sep 2022, 21:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18960
Location: In your JS exploiting you and your system
revolution 10 Sep 2022, 22:31
By default fasm uses the environment variable named INCLUDE. You need to set up your environment to have the INCLUDE variable point to your path.
Post 10 Sep 2022, 22:31
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18960
Location: In your JS exploiting you and your system
revolution 11 Sep 2022, 04:46
dogrules23 wrote:
So I need to edit the source code to get it to work properly?
Since your source file uses an absolute path then you either need to alter the source to match your install path, or change you install path to match what the source has been set for.

Using absolute paths is the problem. I would suggest you alter your source to make it more friendly by using relative paths.
Post 11 Sep 2022, 04:46
View user's profile Send private message Visit poster's website Reply with quote
FlierMateI



Joined: 12 Sep 2022
Posts: 6
FlierMateI 12 Sep 2022, 06:17
If you use FASMW.exe (the editor that comes with FASM for Windows), you don't need to specify the path of the INCLUDE folder.

The beginning of my Assembly source files are as below:
Code:
format PE console
entry start         
include 'win32a.inc'    


But if you compile from command-line, use relative path like that suggested by @revolution will do.


Description: Compiler setup in FASMW.exe
Filesize: 10.05 KB
Viewed: 794 Time(s)

Screenshot 2022-09-12 141404.png


Post 12 Sep 2022, 06:17
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.