flat assembler
Message board for the users of flat assembler.

flat assembler > Linux > Help with Linux flat assembly

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Fixit



Joined: 22 Nov 2012
Posts: 161
I installed flat assembler on Puppy Linux 5.6.0.

Package manager could not find it, so I did a manual install.

It said is was in the Utility section, but it isn't there.

I had to give up on Nasm because of a lack of help.

Hope you guys can help me.

Thanks,
Andy
Post 10 May 2014, 22:15
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Simply put fasm in any path specified directory and you are OK. /usr/local/bin for example.
Although you have to define some environment variables, for example "include" pointing to the place where the FASM include files resides.
Post 10 May 2014, 22:20
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Ah, fasm for Linux is console application. It will not resides in the GUI start menu. (And even if you put there it will be useless from the GUI menu, because you have specify the source file to be compiled from the command line.
Post 10 May 2014, 22:22
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
I found the examples, but none run.

They are set to executable.

Thanks.
Post 10 May 2014, 23:28
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1147
What do you mean they don't run?

Have you opened a terminal and tried to cd <some_path>/examples/elfexe ; ./hello or something?

Post the error verbatim so we may help you.

Note that neither fasm (like JohnFound said), nor the examples, are graphical applications on *nix systems.
For that you'll have to learn GTK+ or Qt or any other widget toolkit, in addition to assembly.


Last edited by ManOfSteel on 11 May 2014, 08:11; edited 1 time in total
Post 11 May 2014, 08:06
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 340
Location: Asia, Singapore
You should run like this:
./fasm dudeitsfasm.asm
If it complains about "executable permissions", use chmod and force it to become an executable.
chmod +x fasm
And better put in the /bin directory as others have said, if you want to use it anywhere. Btw when will FASM be downloadable from package managers? Smile
Quote:
I had to give up on Nasm because of a lack of help.

Yeah, NASM forums are useless IMO, I couldn't get myself registered (Some random moderator didn't approve me for absolutely no reason), FASM rocks. Cool
Post 11 May 2014, 08:10
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1147
sid123 wrote:
Btw when will FASM be downloadable from package managers? Smile

Feel free to create your own package, contribute it to your favorite distro's repository and keep it up to date by becoming its maintainer! Idea

Or doesn't it work this way for Linux?


Last edited by ManOfSteel on 11 May 2014, 08:20; edited 1 time in total
Post 11 May 2014, 08:17
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
And of course, if you want GUI editor/compiler, you can always install WINE and run FASMW and/or Fresh IDE in Linux. (This is what I do with great success).
Post 11 May 2014, 08:19
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
ManOfSteel wrote:
What do you mean they don't run?

Have you opened a terminal and tried to cd <some_path>/examples/elfexe ; ./hello or something?

Post the error verbatim so we may help you.

Note that neither fasm (like JohnFound said), nor the examples, are graphical applications on *nix systems.
For that you'll have to learn GTK+ or Qt or any other widget toolkit, in addition to assembly.


I will try it your way.

Interesting, I though .asm files were only the source code.

Andy
Post 11 May 2014, 20:24
View user's profile Send private message Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
I am making progress. I was typing fasm hello.asm instead of using ./fasm etc.

Is fasm a script then ?

Andy
Post 11 May 2014, 20:33
View user's profile Send private message Reply with quote
gens



Joined: 18 Feb 2013
Posts: 159
fasm is a console program
to "install" it just copy the binary to /usr/bin/

i was thinking of making a slackware package, but doubt many people would use it
(slacko puppy is compatible with slackware)

if you got questions about using a shell, ask away
Post 11 May 2014, 23:27
View user's profile Send private message Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
Thanks.

Do you have any scripts to speed things up ?

How do I get fasm to know where the include files are ?

I have not been able to figure out how to add dirs to my path.

The MASM32 package uses batch files for assembling and compiling Win32 progs.

I posted a message at a GTK+ forum for help in developing GUI programs.
In the meantime, I will work with the examples to get up to speed.

Andy
Post 11 May 2014, 23:55
View user's profile Send private message Reply with quote
gens



Joined: 18 Feb 2013
Posts: 159
include in fasm is relative to the current file it's processing
include "../some_file.inc" would include a file from the parent directory

PATH environment variable can be added to by typing
export PATH=$PATH:/some/dir
try: echo $PATH
you can put the shell command in a file then either make it executable and run or use the dot... whatever its called (operator i think)
. my_shell_env_things.sh

to make it permanent add it to .bashrc (dot here means it's hidden) in your home dir

idk about masm, fasm is source driven
making a shell script for quick compile-test helps thou

!#/bin/bash
fasm my_program.asm
./my_program

is what i do

if you are talking about including headers from C libraries you need to convert them to fasm syntax manually
(i seen some C header to fasm include... i think it was a perl script, but i do them manually)

PS "~" is an abbreviation for the home directory (try "echo ~" or "echo $HOME") so you can do stuff relative to home directory like "nano ~/.bashrc"
Post 12 May 2014, 01:19
View user's profile Send private message Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
I modified one of the examples and it assembled and ran fine.

Is there some equivalent of the Windows API for Linux ?

For example moving files, deletions, etc.

Thanks.
Post 12 May 2014, 14:06
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Fixit wrote:
Is there some equivalent of the Windows API for Linux ?
For example moving files, deletions, etc.


1. Linux system calls
2. Millions of external libraries in /lib; /usr/lib; /usr/local/lib

For the Linux system calls you can read the great assembly-centric reference of the LSCR project.

I am hosting it for online access at http://fresh.flatassembler.net/lscr/ and it is included in the Fresh IDE default help set, accessible by F1 key on the keyword.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 12 May 2014, 14:13
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
Thanks.

I can not figure out how to install FreshIDE using Wine.

I extracted all files to /tmp but did not know which one to pick for installation.

Andy
Post 12 May 2014, 17:38
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Fixit wrote:
I can not figure out how to install FreshIDE using Wine.


There are several ways to "install" Fresh.

0. Install wine

Variant1:
1. Extract the downloaded .zip file in a place where it will reside. /tmp is not a good idea. Better use your home directory or /home/yourname.
2. After extraction simply run Fresh: "wine Fresh.exe" or create launcher depending on your desktop environment. There is desktop file: Fresh/IDE/mime_type/fresh.desktop - It is a text file. You can edit it in order to set the proper paths and then copy it to the Desktop folder.

After the first run, Fresh will automatically set needed paths.

Variant2:
1. Download FreshSetup.exe, run it and follow the installation wizard. It will by default install Fresh in the directory "/home/your_name/.wine/drive_c/Program files/Fresh"
2. Run Fresh in order to auto setup the paths. You still can use the .desktop file in order to make shortcut on the desktop.

More details on "fresh.desktop";
1. It resides in the directory: /Fresh/IDE/mime_types/fresh.desktop
2. But because it is some kind of special file, you can see it in the file manager as "Fresh IDE" - open it with some text editor:
Code:
[Desktop Entry]
Type=Application
Icon=%fresh%/IDE/mime_types/Fresh.svg
Name=Fresh IDE
Categories=Development;
Exec=wine "%fresh%/Fresh.exe"
StartupNotify=true
Terminal=false
Name[en_US]=Fresh IDE
Comment=<empty>
Comment[en_US]=Visual assembly language IDE
GenericName=Assembly language visual RAD IDE.
Path=    

3. Replace "%fresh%" with the full path where you installed Fresh. There are 2 rows you have to edit: "Icon=" and "Exec=".
4. Save the file.
5. Copy it where you want:
5.1 In you desktop directory: /home/your_name/Desktop
5.2 In "/usr/share/applications" in order to get it in the start menu. (You will need root privileges in order to copy it there). After this, Fresh IDE icon will appear in your start menu under the category "Development" or "Programming" depending on your desktop manager.

As long as Fresh is not actually "installed" - it will not change anything in your system, you can always delete the whole directory, without affecting the OS. If you copied the .desktop file you should delete it as well.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 12 May 2014, 18:16
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1147
Fixit wrote:
Do you have any scripts to speed things up ?

As an alternative to using shell scripts for automation, you can also use Makefiles.
Post 12 May 2014, 18:57
View user's profile Send private message Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
Everything went well with the install.

Can I open a window within Fresh to see my programs run and their output ?

Thanks.
Post 13 May 2014, 22:33
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Fixit wrote:
Can I open a window within Fresh to see my programs run and their output ?


If you are talking about console window, yes you can. Set the field "Linux terminal" in "Options|IDE options|Debuggers and emulators" dialog.

I am using following line: "z:/usr/bin/xterm -hold +mesg", but you can set whatever terminal you want.

It is also recommended to set "Linux debugger" and "Win32 external debugger" fields.

My settings about these fields are:
Linux debugger = "z:/usr/bin/edb --run" (You will need EDB debugger installed)
Win32 debugger = "C:\Program Files\OllyDbg\OLLYDBG.EXE" (You will need Olly debugger installed - it works in WINE just fine.)

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 14 May 2014, 04:57
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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.