www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/01/05:04:26

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help with Inline Assembly in DJGPP
Date: Sat, 01 Feb 1997 02:42:43 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 48
Message-ID: <32F31E23.579B@cs.com>
References: <Pine DOT SV4 DOT 3 DOT 94 DOT 970131204350 DOT 10972D-100000 AT aludra DOT usc DOT edu>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp103.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

rellwood wrote:
> 
> Can someone please explain how convert Turbo C++ inline Assembly to
> DJGPP's format?  For example, one piece of my code looks something like
> this:
> 
> (As you can guess from the variable names, this is *suppose to* copy data
> from a double buffer to the real video buffer.)

First, there are a number of ways to deal with the assembly format of
DJGPP:

- Use any of several excellent reference works on switching from Intel
to AT&T assembly format.  The best one I know of is at
<http://www.rt66.com/~brennan/djgpp/djgpp_asm.html>.  Look at the rest
of the stuff on his web pages for more links and information.

- There is a free assembler called NASM that understands the Intel
format and outputs DJGPP-compatible COFF code.  The URL is
<ftp://ftp.simtel.net/pub/simtelnet/msdos/asmutl/nasm093.zip>.

But there is another problem with your code.  Because DJGPP programs run
in protected mode, you can't just go around accessing any random
absolute memory address and expect it to work.  The DJGPP Frequently
Asked Questions list (v2/faq210b.zip from SimTel) has extremely detailed
instructions on the various ways to handle graphics and other
hardware-related programming in chapters 10, 17, and 18.  I suggest you
read them thoroughly before going any farther afield.  :)

There are also several very good graphics libraries available for DJGPP
that can significantly reduce the pain of learning protected-mode
graphics.  One such is Allegro, a professional-quality game programming
library available from SimTel (v2tk/alleg21.zip) and the Oulu repository
at <ftp://x2ftp.oulu.fi/pub/msdos/programming/djgpp2/alleg211.zip>. 
Don't worry about the different filenames - both files have the same
version of the library (it's a long story).

Hope this helps!

-- 
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------

- Raw text -


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