[PLUG] Porting app from Windows to Linux

Shahms King shahms at shahms.com
Wed Jun 15 20:36:32 UTC 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Russell Senior wrote:
|>>>>>"Keith" == Keith Lofstrom <keithl at kl-ic.com> writes:
|
|
| Keith> 1) What tools are available to help port the C and the
| Keith> assembler code?
|
| Not sure about the assembler, but for C I tend to just throw gcc at it
| and see where it chokes, fix, rinse, repeat.  Then check the output
| to see if it generates the same thing as the original.  I'd be
| inclined to ditch the assembler and recode that part in C.  Presumably
| he understands what the assembler does.  Then profile and think about
| whether the assembler still makes sense.

Do you mean C or C++? If he's using Qt for the GUI already, it's likely
C++ (and if he's using Qt for most things, probably already pretty close
to ported). I suppose the best route to take is to find anywhere in the
code that uses Win32 calls directly and port those calls to the Qt
equivalent.  Another relevant portion is the toolchain he's currently
using: writing a decent Makefile or autotooling the project may be ...
difficult.

The assembler is likely in Intel syntax while almost all of the assembly
tools for Linux expect AT&T syntax.  They are largely the same with
minor annoying differences (like operand ordering).

A quick google brought up this reference which seems to be pretty good:
http://heather.cs.ucdavis.edu/~matloff/50/LinuxAssembly.html

There is also a tool to convert from Intel syntax to gas (GNU
Assembler/AT&T):
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/

However, his best alternative is going to be to use NASM, which works
under Windows and Linux (and a *lot* more platforms) and uses the Intel
syntax, I believe:
http://nasm.sourceforge.net/

- --
Shahms E. King <shahms at shahms.com>
Multnomah ESD

Public Key:
http://shahms.mesd.k12.or.us/~sking/shahms.asc
Fingerprint:
1612 054B CE92 8770 F1EA  AB1B FEAB 3636 45B2 D75B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFCsJFQ/qs2NkWy11sRAkWUAJwMGtZ++4pLuMv2lp+JWohx5YZlZACfeheo
zIF3W+diFev1S8Zfk48Za1w=
=ttuj
-----END PGP SIGNATURE-----



More information about the PLUG mailing list