From: "John M. Aldrich" 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: Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp103.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 . 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 . 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 . 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 -----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------