Date: Mon, 30 Nov 1998 09:55:29 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Nathaniel Johnson cc: djgpp AT delorie DOT com Subject: Re: Assembly in DJGPP In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sun, 29 Nov 1998, Nathaniel Johnson wrote: > I am tring to port a program from Microsoft C and MASM to djgpp and I > was wondering if anyone can tell me if I can leave the MASM assembly files > the way they are and compile with MASM or if I need to port them with > NASM. Most probably, you will have to abandon MASM, since it usually produces .obj files which are incompatible with DJGPP. (MASM 6 reportedly has an option to produce COFF format, but I heard reports that its COFF is not 100% compatible with DJGPP either.) Section 17.5 of the DJGPP FAQ list (v2/faq211b.zip from the same place you get DJGPP) explains this issue in more detail. However, the more important problem is that the assembly code you have was probably written for a real-mode program. If so, it does things which will immediately crash your program in protected mode. (See sections 17.3 of the FAQ for more about this.) So you will probably need to rewrite that code anyway. > (If I do need to port to NASM, is there a tutorial on NASM, or > djgpp inline assembly) See section 18.13 of the FAQ, it has some pointers to available docs. You need also to be aware that sometimes it is much easier to rewrite the assembly as C code. Many real-mode programs used assembly just to issue DOS/BIOS interrupts, which is much easier done in C. Section 17.8 of the FAQ gives an example.