flat assembler
Message board for the users of flat assembler.

 Index > Main > cygwin
Author
triglav

Joined: 20 Feb 2004
Posts: 6
Location: Slovakia
triglav
hi, I'm writing a cross-platform (win32, linux) game in C++ (SDL). I'd like to use asm for some optimizations. I'm using GCC compiler. win32 binaries are compiled using Cygwin. I'd like to know whether it is possible (in some way) to use FASM & Cygwin together. thx
06 Aug 2004, 15:10
decard

Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
06 Aug 2004, 15:34
triglav

Joined: 20 Feb 2004
Posts: 6
Location: Slovakia
triglav
decard wrote:

I'm using GNU Auto-tools system for building the whole project (source, scripts, documentation, etc.), have you any idea, how to solve the checking for extern (non Cygwin) application (FASM[W].exe)? is there any common used %FASM% like enviroment variable under win32?
06 Aug 2004, 15:56
vid
Verbosity in development

Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
only FASM's environment variable is %FASMINC% pointing to FASM's include directory. This directory is usually (99%) located inside directiry that contains compiler, so you can use "%FASMINC%\..\fasm.exe". Not general, but usually should work.
08 Aug 2004, 17:33
triglav

Joined: 20 Feb 2004
Posts: 6
Location: Slovakia
triglav
"usually" is philosophy of micro\$oft, not mine . another idea?
09 Aug 2004, 21:07
ShortCoder

Joined: 07 May 2004
Posts: 105
ShortCoder
Shame Cygwin can't run direct Linux binaries. Also, since the fasm assembler is, itself, written in fasm, you are at a sort of "chicken and the egg" case here.

The only solution I can see, if you want fasm to work from within cygwin, is to port the fasm sourcecode to gas syntax, and then assemble the fasm executable from gas. Then you may proceed to code using fasm under cygwin.

Ugly, I know, but it's all I could come up with.

Better yet, once you have done that, then use the fasm executable generated from gas source to assemble another fasm executable, this time from the fasm source, and then use that final executable from then on? (and contribute it to these boards, maybe;))

_________________
Boycott Symantec/Norton/PowerQuest whenever possible
28 Aug 2004, 09:37
proveren

Joined: 24 Jul 2004
Posts: 68
Location: Bulgaria
proveren
Since you would do it only for some optimization, try to find a doc with the right syntax of the gcc _asm() directive(or function how should i name it?). It is very confusing indeed, but there is.

By the way avoid M\$ and micro\$oft notation. I got laughed at in the GameDev.Net forum when using it in a post.
28 Aug 2004, 10:06
triglav

Joined: 20 Feb 2004
Posts: 6
Location: Slovakia
triglav
what do you think about NASM? Vid told me that it's dead however on linux platforms it's widely spread.
28 Aug 2004, 10:16
crc

Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
Quote:
what do you think about NASM? Vid told me that it's dead however on linux platforms it's widely spread.

It is still a good assembler. I used it for years (I didn't fully switch to FASM until this July). It has bugs, is updated infrequently, but the documentation that exists is good. Personally, I now prefer FASM though. (oh, other than some of the directives, and macro facilities, NASM and FASM are nearly compatible. For example, the FASM source for RetroForth can be converted to NASM by changing the macros and five or six lines of source code. (rb -> resb, file -> incbin, include -> %include, and so on)
28 Aug 2004, 11:12
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
It would be possible to create some headers allowing FASM to assemble some of the NASM syntax, something like:
Code:
```%include fix include
resb equ rb
resw equ rw
resd equ rd
incbin equ file    ```

You can even try to emulate the simplest variants of NASM macros:
Code:
```macro %macro count
{
0 fix
1 fix %1
2 fix %1,%2
3 fix %1,%2,%3
4 fix %1,%2,%3,%4
5 fix %1,%2,%3,%4,%5
6 fix %1,%2,%3,%4,%5,%6
7 fix %1,%2,%3,%4,%5,%6,%7
8 fix %1,%2,%3,%4,%5,%6,%7,%8
def fix count
0 fix _0
1 fix _1
2 fix _2
3 fix _3
4 fix _4
5 fix _5
6 fix _6
7 fix _7
8 fix _8
macro def {
}

_0 fix 0
_1 fix 1
_2 fix 2
_3 fix 3
_4 fix 4
_5 fix 5
_6 fix 6
_7 fix 7
_8 fix 8

%endmacro fix }

; Now some of the simplest macros from NASM documentation:

%macro  prologue 1

push    ebp
mov     ebp,esp
sub     esp,%1

%endmacro

%macro  silly 2

%2: db      %1

%endmacro    ```
28 Aug 2004, 11:24
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum