delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/25/00:37:46

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199706250437.AA082723447@typhoon.rose.hp.com>
Subject: Re: Newbie Q's
To: csantill AT lausd DOT k12 DOT ca DOT us (LP)
Date: Tue, 24 Jun 1997 21:37:27 PDT
Cc: djgpp AT delorie DOT com
In-Reply-To: <199706250050.RAA63654@lausd.k12.ca.us>; from "LP" at Jun 24, 97 4:37 pm

> 1)  How can I setup RHIDE 1.3 to output the compiled *.O's & *.EXE's to the
> same directory as the source file(*.C)?
Don't quite get this.  Thats what it should be doing by default.  Do you 
have your files in multiple directories maybe?

> 2)  How different is DJ Pascal from TP/BP 7.0?  Are there many
> incompatible/unsupported keywords?  Are there any extensions?  Is it easy
> to wrap DJ Pascal around ASM?
Check the archives for more discussion on this.  I believe there are
some extensions in TP that are not present in GNU.  I've never used
gnu though.

> I want to write my own graphics library for VGA & VESA graphics library
> w/accompanying Mouse & Joystick libraries.  The reason I switched to DJGPP
> is because the 32-bit protected mode & promise of better speed for games &
> graphics.  I'm too stubborn to learn even remotely complicated graphics
> systems like BGI & Allegro so would rather just write my own.
IMHO - Bad choice.  Allegro is very easy to use, has a huge amount
of development time in it, and supports a wide variety of hardware for
graphics and sound. It is also the de facto djgpp standard.
 Now, if you wanted to write your own library for
the experience of it that would be a different matter.

> 3A)  I'd like to write these library functions mostly in C, Pascal, & ASM. 
> I'm used to Borland style C & Pascal so I like using Intel ASM.  Is there a
> way to setup RHIDE 1.3 to default to compiling Intel ASM?
Rhide doesn't compile anything.  It just invokes gcc to do the work.  
The only way I know of is to use NASM, but this requires compiling to
.o files, you couldn't make an inline say.  I find it pretty easy to
write in AT&T syntax as long as I comment every line with its intel syntax
counterpart.

>  If not, where is
> the most complete tutorial on learning the difference & translation of
> Intel ASM to AT&T ASM?  Here's an example of the kind of stuff I want to
There are a couple of guides out there.  Start at SETs home page or go to
Brennan's.  Don't have the exac URLs but they are in the archives 
and yahoo can probably find them as well...

> 
> 3B)  I'm not used to Protected mode Memory access, so what the easiest way
> to *poke* byte values into memory w/ or w/o memory protection?
Look up the far pointer and near pointer routines in libc reference (or faq)

> 
> 3C)  What's the easiest way to call 16-bit interrupts(like the mouse, &
> VGA) & 32-bit interrupts(like VESA), thru one of the protected mode
> functions or thru ASM?
>
look up __dpmi_int in libc (in faq too)
 
> 3D)  Can you call 32-bit interrupts w/ the built in inline ASM calls?
Like protected mode dpmi interrupt calls.   Why not?

> 
> 4)  I'm interested in porting some ZIP, TAR, GIF87/89, JPG, BMP, & Huffman
> compression file filters but I have problem.  Some of these formats use bit
> compression.  Is there a built in function to test individual bit in a
> byte, word, & dword?  Is there a work around?  Here's what I'd like the
> function to do(Pascal example).
> 
> Return of function(possible err)--+
> Check if it's this value(0-1)-+        |
> The Bit # to Test(0-7)-+        |         |
> The Byte to Test---+    |         |         |
>                                 \|/   \|/       \|/       \|/
> TestByteBit(Byte B, Bit, Test):Byte
This is typically implemented as a macro
(Untested code follows, I'm at home so I can't direct copy the routines
but its pretty simple)

#define BIT_IS_SET(byte, position) (byte & (1 << position))
You could also have a BIT_NOT_SET check then.

> Sorry if this stuff seems redundant to the list but I would truly like to
> take full advantage of DJGPP.
> 
Be sure to download the faq, plenty of stuff you asked is covered in it.
Also check out some of the web pages, they have good links.  Last,
if you are interested in a test version of the compiler (read faster code
generated), go to www.goof.com/pcg
for a pentium optimizing gcc.  Don't go there today though, 
as I will be releasing a 
new version of it (970621) by weeks end 
(its built and ready, just going through 
a test period.)

Andrew













- Raw text -


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