This file is shared

MainSite

Wiki

Bugs

Download

Translations

CompilingAnAssemblyProgramWithGNUAsOnGNewSense

cogburnd02?06 August 2008, 14:35

I want to compile a program i found on the internet, JansFlame, to run on gNewSense (with GNU as). It can be found at http://www.sulaco.co.za/downloads.htm and seems to be free software-- the Readme says: "The program is allowed to be copied, modified, whatever you want." The source code comes with the .zip file as well. I've never compiled an assembly program before, but this is (seems to be) written in a different syntax than 'as's syntax. Is there a way to convert it? I really liked this program back when i used Microsoft Windows (before I switched to Gentoo, then gNewSense) I was just wondering if some coder could help me out a bit. Thanks, cogburnd02

gnoe08 August 2008, 03:03

AFAIK, it's impossible to convert an assembly program to C.

Someone could contradict me, but I think it's still a very difficult task to accomplish.

hutchiep19008 August 2008, 03:14

I don't think he means converting from assembly to C. I think he's talking about the difference between AT&T syntax and Intel syntax. AT&T syntax is what's traditionally used by GAS but for a while now, it's supported the Intel syntax too through a directive .intel_syntax or something like that. I assume this means that you place a line in the file with that directive above everything else, but I've never used it. Look up the documentation for GNU as / gas and you'll find it.

I can suggest though that when you do try to compile it, use

 gcc -o programname programname.s

where programname.s is the assembly file because gcc knows how to link it correctly. I'm not so sure that it will work if it wasn't developed for GNU/Linux though. Maybe it will, I'm really not an expert on that, I've only played with some Hello, World! programs to try to understand the syntax so I haven't assembled any "real" programs before.

cogburnd02?19 August 2008, 03:39

Could someone perhaps give me a link to a program in the intel syntax known to compile with as on GNS? (To analyze the syntax) Or is there just maybe a site with stuff like that (programs in various syntaxes known to compile on various assemblers) on it somewhere?

You must be logged in to post.

Edit - History - Print - Recent Changes - Search
Page last modified on August 19, 2008, at 03:39 AM
Content is licensed under the GFDL (without invariant sections).
This project is run with the assistance of the FSF.