flat assembler
Message board for the users of flat assembler.

Index > Linux > Cross-platform ASM

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



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
I am interested in writing code which will compile for Windows as well as Linux.

Does anyone have experience doing this with FASM? Any hints appreciated.
Post 08 Jan 2004, 19:02
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
FASM itself is an example of cross-platform app - take a look at the source. System.inc and fasm.asm files contain platform-dependent code, while all other sources are platform-independent.
Post 08 Jan 2004, 19:27
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
decard wrote:
FASM itself is an example of cross-platform app - take a look at the source. System.inc and fasm.asm files contain platform-dependent code, while all other sources are platform-independent.

Ah, yes - but I was hoping to be able to do something like define a constant in my main file and have FASM compile that main source into one or the other version.

I guess it is just as good to have two different start files and include the common components.
Post 09 Jan 2004, 17:17
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
See "Conditional assembly" on FASM.TXT
Post 09 Jan 2004, 20:17
View user's profile Send private message Yahoo Messenger Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
pelaillo wrote:
See "Conditional assembly" on FASM.TXT


Much?simas gracias. I'll play with it a little. (it seems UTF8 encoding is not supported in messages Confused )
Post 09 Jan 2004, 21:04
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
ronware wrote:
(it seems UTF8 encoding is not supported in messages Confused )

Maybe this can be helpfull:
http://board.flatassembler.net/topic.php?t=307&highlight=utf8

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 09 Jan 2004, 23:59
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
scientica wrote:
ronware wrote:
(it seems UTF8 encoding is not supported in messages Confused )

Maybe this can be helpfull:
http://board.flatassembler.net/topic.php?t=307&highlight=utf8

Heh. That's interesting, but I meant messages on the board, not message strings inside my code.
Post 11 Jan 2004, 02:23
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
ronware wrote:
Heh. That's interesting, but I meant messages on the board, not message strings inside my code.

You mean that you can't use UTF8 in a post here?
(I think this should be UTF8 encoded text:)
åäöÅÄÖあい 人
(shloud be lowercase, a+ring, a+umlat, o+umlat, then the three in uppercase, then in hiragana 'ai', and finally a space and then the kanji hito (or rén))

If you don't see it change the Character Coding in your browser to Unicopde/UTF8

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 11 Jan 2004, 11:55
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
scientica wrote:
ronware wrote:
Heh. That's interesting, but I meant messages on the board, not message strings inside my code.

You mean that you can't use UTF8 in a post here?
(I think this should be UTF8 encoded text:)
???????? ?
(shloud be lowercase, a+ring, a+umlat, o+umlat, then the three in uppercase,
then in hiragana 'ai', and finally a space and then the kanji hito (or r?n))

If you don't see it change the Character Coding in your browser to Unicopde/UTF8


The kana showed up fine. The following text should be Hebrew: ????

I do have the browser set to utf8, and the Hebrew is showing up in the composer window
Post 12 Jan 2004, 00:20
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
Hmm, all I see is "????" (even in the quoted text)
btw, what browser do you use? (I use Mozilla Firebird, on linux, I cut&paste the UTF8 code from emacs)


one little note, the UTF8 text was converted to "&# (number) ;"-format after I had chosen previev.

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 12 Jan 2004, 05:45
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
scientica wrote:
Hmm, all I see is "????" (even in the quoted text)
btw, what browser do you use? (I use Mozilla Firebird, on linux, I cut&paste the UTF8 code from emacs)


one little note, the UTF8 text was converted to "&# (number) ;"-format after I had chosen previev.

All I see now is ????, too. I was using Opera on Linux. Now I'm using Opera
on Windows ... let me retry: ????!
Post 12 Jan 2004, 05:58
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
ronware wrote:
scientica wrote:
Hmm, all I see is "????" (even in the quoted text)
btw, what browser do you use? (I use Mozilla Firebird, on linux, I cut&paste the UTF8 code from emacs)


one little note, the UTF8 text was converted to "&# (number) ;"-format after I had chosen previev.

All I see now is ????, too. I was using Opera on Linux. Now I'm using Opera
on Windows ... let me retry: ????!

OK, that sucks. Now here's using IE -- on Windows ... שלום!
Post 12 Jan 2004, 06:00
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
ronware wrote:
OK, that sucks. Now here's using IE -- on Windows ... שלום!

Well, it appears IE works ok and Opera doesn't Sad
Post 12 Jan 2004, 06:02
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
ronware wrote:
ronware wrote:
OK, that sucks. Now here's using IE -- on Windows ... ????!

Well, it appears IE works ok and Opera doesn't Sad


I notice you are using phpBB2. I also am running a board with it, and I modified the template pages to have charset="utf-8" in my setup so my pages all work with utf8 properly.
Post 12 Jan 2004, 06:21
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
jInuQ



Joined: 26 Jun 2003
Posts: 48
Location: USA - NV
jInuQ
I can see שלום! and åäöÅÄÖあい 人 but not the the hebrew from ronware's first post. Using Mozilla Firebird 0.7.

_________________
jInuQ

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint Exupery
Post 12 Jan 2004, 19:09
View user's profile Send private message Visit poster's website AIM Address Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
ronware wrote:
decard wrote:
FASM itself is an example of cross-platform app - take a look at the source. System.inc and fasm.asm files contain platform-dependent code, while all other sources are platform-independent.

Ah, yes - but I was hoping to be able to do something like define a constant in my main file and have FASM compile that main source into one or the other version.

I guess it is just as good to have two different start files and include the common components.


So I can do what I want like this:

Code:
LINUX=0  
WINDOWS=1

BUILD=LINUX

if BUILD=LINUX
   display 'Building LINUX'
   include 'fl.asm'
else if BUILD=WINDOWS
   display 'Building WINDOWS'
   include 'fw.asm'
end if
    

Which is pretty cool. I have a makefile which does this:
Code:
f: f.asm fl.asm
      sed -e "/^BUILD=/s/=.*/=LINUX/" < f.asm > ftop.asm
  fasm ftop.asm f

f.exe: f.asm fw.asm
      sed -e "/^BUILD=/s/=.*/=WINDOWS/" < f.asm > ftop.asm
        fasm ftop.asm f.exe
    

It would be more elegant if I could tell FASM to define a macro from the command-line, but this works OK.
Post 14 Jan 2004, 19:57
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
ARRGH.

The 'conditional compilation' is not really true. In my example, 'fl.asm' gets read in even if the WINDOWS compilation is selected.

How does one prevent this? It cannot be the desired effect, I think.
Post 14 Jan 2004, 20:06
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Actually conditianal assembly is true, but conditional preprocessing - not. Preprocessor directives like include are processed before if's. Partially this problem was solved in following thread: http://board.flatassembler.net/topic.php?t=492

regards
Post 14 Jan 2004, 21:43
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
Wow, that's cool (albeit funky). So I do have real preprocessed includes now, though they are anything but intuitively done...

Thanks a lot!
Post 14 Jan 2004, 22:57
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
rob.rice



Joined: 20 Dec 2003
Posts: 54
rob.rice
I don't know where to find it BUT there is an example of what you want to do It's called e3 its an editor for linux or windows BUT the source code is writen for nasm and would be veary hard to port to FASM
Post 15 Jan 2004, 03:50
View user's profile Send private message 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-2020, Tomasz Grysztar.

Powered by rwasa.