The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => The Orphanage => Topic started by: shankle on February 19, 2009, 12:34:23 AM

Title: about FASM
Post by: shankle on February 19, 2009, 12:34:23 AM
I know my knowledge of Ubuntu and Fasm is sparse.  On the otherhand I've spent 8 hours trying to compile a 12 line proggie on FASM.
I am finding the people on the FASM board either don't answer or give sparse info. Actually I get more help on the Ubuntu forum.
I know you are saying why don't you figure it out yourself. IMHO that's not the proper way to go about learning a new subject.
My method is to pick up a book like "FASM for dummies" and then go on to a more complex book on the subject. Now I should have a basis for starting a simple program. It's not at all like that with FASM. For Instance, I just found out about the "command shell"  today which is a must
learning thing for Ubuntu. Maybe it's my lack of knowledge of FASM but I swear there is no GUI for it. My little proggie prints on the screen
in what looks like the old Basic language "1st Proggie". At this point I have no idea how to change fonts  or the position on the screen or
change colors. In fact I don't see any evidence that FASM handles these items. It must, so it's off to do the detective works to find some
tutorial on it. What a way to learn a language.  Also there is no .exe module. Suppose I wanted to market this little program. Does FASM
create an .exe module that can be passed to a potential user?
After all the above Rant maybe someone on this board could straighten me out and reaffirm  my confidence in FASM.
I know I've read many things about the Microsoft/Linux debate but I think it also pays to have your eggs in more than one basket.
I would appreciate some FASM orientated persons comments before I give up.
Title: Re: about FASM
Post by: sinsi on February 19, 2009, 01:22:35 AM
Why don't you try FASM in windows first, to get an idea of the syntax, then try in linux.
Are you phenix?
Title: Re: about FASM
Post by: shankle on February 19, 2009, 02:12:17 AM
Hi Sinsi,
Yes that's me.
I'll give it a whirl in Windows
Thanks
Title: Re: about FASM
Post by: hutch-- on February 19, 2009, 12:12:46 PM
Jack,

Have a look at the FASM forum, there are a lot of people there who know FASM well so they may be able to help you.
Title: Re: about FASM
Post by: PBrennick on February 22, 2009, 06:51:58 AM
Hutch,
Did you even read his post? He wrote:

QuoteI am finding the people on the FASM board either don't answer or give sparse info.

Paul
Title: Re: about FASM
Post by: hutch-- on February 22, 2009, 10:22:53 AM
 :bg

Paul,

With the age of my eyesight, large blocks of unpunctuated text are hard to read so I tend to skim the contents. I REALLY DO like text that has PARAGRAPHS as I read it much better and much faster.

Jack,

Quote
I know you are saying why don't you figure it out yourself. IMHO that's not the proper way to go about learning a new subject.

This is more a UNIX phenomenon than just FASM. With anything to do with UNIX you are already supposed to know how to do everything and if you don't you get treated like an idiot. Where I have to deal with anything UNIX I search the internet for it rather than wait for some DUMBPHUK who would rather keep it to themselves wasting my time.
Title: Re: about FASM
Post by: japheth on February 22, 2009, 12:42:41 PM
Quote from: hutch-- on February 22, 2009, 10:22:53 AM
This is more a UNIX phenomenon than just FASM. With anything to do with UNIX you are already supposed to know how to do everything and if you don't you get treated like an idiot. Where I have to deal with anything UNIX I search the internet for it rather than wait for some DUMBPHUK who would rather keep it to themselves wasting my time.

Hm, if I had the choice

a) to be treated politely, but the person who answers my questions won't read them at all    OR
b) to be treated like an idiot, but at least my questions are read and therefore there's a chance for correct answers

then I'll probably will choose option b).

Title: Re: about FASM
Post by: hutch-- on February 22, 2009, 01:23:36 PM
 :bg

Here is a man who has never asked a question in a UNIX forum.

Quote
a) to be treated politely, but the person who answers my questions won't read them at all    OR
b) to be treated like an idiot, but at least my questions are read and therefore there's a chance for correct answers

Here are the other options,


c) Be treated like an idiot and abused for asking the question.
d) Be ignored then insulted for asking the question again.
e) be treated like an idiot then ignored etc etc ....


Go to a UNIX forum and experience the diference.  :cheekygreen:
Title: Re: about FASM
Post by: shankle on February 22, 2009, 02:34:11 PM
I'm trying to put more grease on my back as I need it on the Linux forums.
I just try to ignore the impudence and assume it's coming from some kid whose had computers 101
and written 2 programs and now assumes the status of Genius. I had such an experience on the
NASM board. One punk telling me that I should take up knitting when I would prefer basket weaving
and another gentleman that had retired from the field and gave what I consider an intelligent and
friendly response. I totally ignored the punk.  That's all you can do with this type of person. It'll take
them years to find out they don't know everything. I don't know very much about Ubuntu (2% working on 3%)
but I hope to increase that to at least 5% shortly. I guess I am spoiled by Windows and Masm32 because
Ubuntu is orientated around the line commands (approx 50,000) of them and I consider this an obsolete
way of doing things. When I'm doing something I am more interested in what I am doing instead of having
to go look up some line command.
Sorry for the rant.
jps



Title: Re: about FASM
Post by: PBrennick on February 22, 2009, 03:22:16 PM
Jack,

Two things:

QuoteUbuntu is orientated around the line commands (approx 50,000) of them and I consider this an obsolete
way of doing things. When I'm doing something I am more interested in what I am doing instead of having
to go look up some line command.

This is not going to change, ever. So you learn it or leave it. Why struggle for something that is not going to reap you much in the way of rewards as you are clearly a GUI minded individual.

2. You are struggling in an unwinnable situation. The FASM guys know very little about UNIX (or whatever you wish to call it today) and the LINUX guys all pretty much program in C and look down their noses at those who don't.

While Windows is also a C++ oriented experience (with a modicum of PASCAL just for grins) you can, at least, stumble into some guys who share your dream of programming in assembly and will help.

This is an old, old story that always needs to be re-told for some reason. About your desire to be able to create an EXE that will run in a native UNIX environment; for God's sake man, tell NO ONE over there about that one. You will be branded as an idiot forever!

Paul
Title: Re: about FASM
Post by: shankle on February 22, 2009, 04:16:22 PM
Thanks Paul for you good advice.
So if  am reading you correctly I should drop all attempts at programming related to Linux.
I was thinking that "Sol_Asm"  would at least solve the Assembler compatibility problems.
From the little experience I've had with Ubuntu, IMHO, it  will take them 10 or more years
to get up to date.
So I'll stop trying to program anything on Linux and use the HD I already  have set for  Ubuntu
solely for doing Email and web browsing. This should cut down my vulnerability to viruses
and such in Windows. I have all the necessary programs to do that in Windows and am a
maintenance fanatic.
Regards
Jack

Title: Re: about FASM
Post by: ChrisLeslie on March 16, 2009, 01:47:48 AM
QuoteHere are the other options,


Code:
c) Be treated like an idiot and abused for asking the question.
d) Be ignored then insulted for asking the question again.
e) be treated like an idiot then ignored etc etc ....

Go to a UNIX forum and experience the diference. 

The one that get me is, in a popular java forum, when a question is asked about something that java can't do, then be told that you are stupid to want your program to do such a thing.

Title: Re: about FASM
Post by: BogdanOntanu on March 16, 2009, 04:29:31 AM
Quote
I was thinking that "Sol_Asm"  would at least solve the Assembler compatibility problems.
From the little experience I've had with Ubuntu, IMHO, it  will take them 10 or more years
to get up to date.

Assumning that you intended to link Sol_ASM with C lib on Ubuntu using the ELF OBJ I have provided in the release...  then this command would have helped:

Link with this command:
gcc sol_asm2_unix_elf.obj -o sol_asm2.exe

Test run the created executable:
./sol_asm2.exe


Of course this assumes that your Ubuntu installation has GCC installed.
Title: Re: about FASM
Post by: xmetal on March 16, 2009, 09:32:16 AM
Quote from: BogdanOntanu on March 16, 2009, 04:29:31 AM

Link with this command:
gcc sol_asm2_unix_elf.obj -o sol_asm2.exe

Test run the created executable:
./sol_asm2.exe


Bogdan probably wrote it that way to make it seem "familiar" to you, shankle, however, note that for UNIX and its derivatives, file extentions are usually irrelevant; the permissions, content and type of file are what really matter.
Title: Re: about FASM
Post by: mitchi on March 16, 2009, 01:51:59 PM
I've tested Sol_Asm on my SUSE linux and it works really well ! I was able to compile SOL_ASM and the native code example. I wasn't able to compile the libc example for some reason, I might be missing a dependency...
:bg. I really wonder how can you achieve this portability, you're not even using libc on Windows !!!!! I see you using WriteFile, ReadFile, globalalloc but when you're on Linux what happens ?
Title: Re: about FASM
Post by: BogdanOntanu on March 16, 2009, 03:34:57 PM
Quote from: mitchi on March 16, 2009, 01:51:59 PM
I've tested Sol_Asm on my SUSE linux and it works really well ! I was able to compile SOL_ASM and the native code example.

Good to know. Thanks for testing and reporting this. Sol_ASM should be able to run on all UNIX like systems that have a libC available.
BTW that should also be true for FASM :D
Quote
I wasn't able to compile the libc example for some reason, I might be missing a dependency...
:bg.
I wonder what that dependency could be... ? (maybe _exit ?)
After all if you have been able to build SOL_ASM then the sample should also work... maybe I made a mistake in the sample.

Quote
I really wonder how can you achieve this portability, you're not even using libc on Windows !!!!! I see you using WriteFile, ReadFile, globalalloc but when you're on Linux what happens ?

That is quite simple.
1) I use a minimal set of functions from OS.
==============================
I have a habit to have a very low OS dependency on all of my projects. You might notice that I use my own sprintf function and avoid the libC or Win32 API.

2) There is a portability layer in SOL_ASM.
=============================
Sol_ASM was designed to run on multiple OSes right from day one (on WIn32 and SOL_OS)
All OS dependent functions are going through a wrapper that adapts the parameters and API to the targets OS.
All my code uses my functions with my parameters and my calling conventions.
This way the only place to change anything is in the wrapper functions. No line of code is changed in the Sol_ASM core when I build for another target OS.

3) #ifdef handles OS target inside wrapper functions
==================================
Something like this

#ifdef WIN32
  ... memory alloc function for WIN32
#endif

#ifdef OS_LIBC
  ... memory alloc function for libC
#endif


In fact Hawk ported Sol_ASM on his MAC OSX in a few hours by changing only those functions while learning the Mac OSX calling conventions and stack alignment requirements and without changing anything from SOL_ASM core.

Of course that this portability is made easy by the widespread use of the Intel CPU and the nature of command line like applications because the number of functions to be wrapped are limited: GetCommandLIne, OpenFIle, ReadFile, WriteFile, CloseFile, Memory_Alloc, Memory_Free, WriteToConsole

I am now in the process of making such a system for GUI applications also. This would allow the very same GUI application to run on Windows, Solar_OS, Unix, Mac OSX

However this thread deviates too much from it's original "about FASM" title :D
Title: Re: about FASM
Post by: PBrennick on March 16, 2009, 04:02:05 PM
Bogdan,
I do not want to deviate from the purpose of this thread but felt I need to comment on a couple of things...

Quote
All OS dependent functions are going through a wrapper that adapts the parameters and API to the targets OS.

Quote
I am now in the process of making such a system for GUI applications also. This would allow the very same GUI application to run on Windows, Solar_OS, Unix, Mac OSX

I can only guess at the complexity of those issues. This is truly amazing to me. I can think of no other assembler that even comes close to this. Kudos!  :U

Paul
Title: Re: about FASM
Post by: mitchi on March 16, 2009, 04:47:10 PM
Quote from: BogdanOntanu on March 16, 2009, 03:34:57 PM
Quote from: mitchi on March 16, 2009, 01:51:59 PM
I've tested Sol_Asm on my SUSE linux and it works really well ! I was able to compile SOL_ASM and the native code example.

Good to know. Thanks for testing and reporting this. Sol_ASM should be able to run on all UNIX like systems that have a libC available.
BTW that should also be true for FASM :D
Quote
I wasn't able to compile the libc example for some reason, I might be missing a dependency...
:bg.
I wonder what that dependency could be... ? (maybe _exit ?)
After all if you have been able to build SOL_ASM then the sample should also work... maybe I made a mistake in the sample.

Quote
I really wonder how can you achieve this portability, you're not even using libc on Windows !!!!! I see you using WriteFile, ReadFile, globalalloc but when you're on Linux what happens ?

That is quite simple.
1) I use a minimal set of functions from OS.
==============================
I have a habit to have a very low OS dependency on all of my projects. You might notice that I use my own sprintf function and avoid the libC or Win32 API.

2) There is a portability layer in SOL_ASM.
=============================
Sol_ASM was designed to run on multiple OSes right from day one (on WIn32 and SOL_OS)
All OS dependent functions are going through a wrapper that adapts the parameters and API to the targets OS.
All my code uses my functions with my parameters and my calling conventions.
This way the only place to change anything is in the wrapper functions. No line of code is changed in the Sol_ASM core when I build for another target OS.

3) #ifdef handles OS target inside wrapper functions
==================================
Something like this

#ifdef WIN32
  ... memory alloc function for WIN32
#endif

#ifdef OS_LIBC
  ... memory alloc function for libC
#endif


In fact Hawk ported Sol_ASM on his MAC OSX in a few hours by changing only those functions while learning the Mac OSX calling conventions and stack alignment requirements and without changing anything from SOL_ASM core.

Of course that this portability is made easy by the widespread use of the Intel CPU and the nature of command line like applications because the number of functions to be wrapped are limited: GetCommandLIne, OpenFIle, ReadFile, WriteFile, CloseFile, Memory_Alloc, Memory_Free, WriteToConsole

I am now in the process of making such a system for GUI applications also. This would allow the very same GUI application to run on Windows, Solar_OS, Unix, Mac OSX

However this thread deviates too much from it's original "about FASM" title :D


So that's how it works. You're really amazing you know ! ;)
Title: Re: about FASM
Post by: GregL on March 20, 2009, 11:34:01 PM
I had the best luck writing asm programs for Linux (Ubuntu) with as, also known as Gas, the GNU Assembler.