delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/31/09:58:14

Date: Thu, 31 Dec 1998 16:58:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Luiz Fernando Estivalet <luisoft AT myway DOT com DOT br>
cc: djgpp AT delorie DOT com
Subject: Re: Newbie starting with DJGPP
In-Reply-To: <01be34c5$43b09440$0100007f@localhost>
Message-ID: <Pine.SUN.3.91.981231164222.18906D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Thu, 31 Dec 1998, Luiz Fernando Estivalet wrote:

>     I'm intend to convert my old programs to DJGPP 32-bits.
>     How can i do it in a faster way ? I have written a lotta of code in
> assembler (Intel format) and i don't know how to program in AT&T format.

I suggest to decide which parts of your code really need to remain in 
assembly, and which ones can be rewritten in C.  Sometimes assembly is 
used not for speed, but to invoke DOS/BIOS interrupts; these parts are 
much easier converted to C than to AT&T assembly.

Next, if your assembly code is NOT inline assembly,  you could use NASM 
to compile it.  NASM supports syntax which is very similar (though not 
identical) to MASM and TASM.  See the DJGPP FAQ for the URL where you can 
get NASM.  Inline assembly *must* be written in AT&T syntax, since GCC 
currently doesn't support NASM as its assembler.

If you still need to use AT&T syntax, read on.

>     Is there any tutorial or (simple) code for begginers ? Where can i find
> it ?

Did you read the relevant sections of the DJGPP FAQ list?  Sections 17.1, 
17.2 and 18.13 seem to be particularly relevant in your case.  They 
describe the main differences between the two assembly styles, and point 
you to additional documentation and tutorials.

>     I need some routines like : keyboard handler, flip_screen, creating
> double_buffer, read and write palette entries, pcx reader, and so on...

For keyboard handler, check out the background material in section 18.9 
and 18.11 of the FAQ, and then look at sample code described in section 
22.3.

Every DJGPP program installs a hardware keyboard handler as part of the
startup code, so you can also look in the library sources (djlsr202.zip, 
file src/libc/go32/exceptn.S).

In case you didn't know, the DJGPP FAQ is available as v2/faq211b.zip 
from the same place you got DJGPP.

> P.S : I'm not intend to use Allegro library.

Unless you see this project as a means to learn protected-mode
programming, I doubt that avoiding Allegro is a wise decision: Allegro
incorporates a body of knowledge and experience of many people over
several years, which would be almost impossible to reinvent in a short
time.  Your real-mode code will have to be not only converted to another
assembly syntax, but also rewritten in large parts, since it won't work in
protected mode, so a lot of it won't survive anyhow. 

But even if you decide not to use Allegro, you will benefit a lot from 
looking at its sources.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019