delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/08/00:29:50

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: New user's questions
Date: Mon, 07 Apr 1997 06:27:03 -0700
Organization: Two pounds of chaos and a pinch of salt
Lines: 61
Message-ID: <3348F627.13C2@cs.com>
References: <3349227c DOT 0 AT 138 DOT 100 DOT 56 DOT 25>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp226.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Arturo Colorado Garin wrote:
> 
> 1) Is it possible to link .O objects files generated by DJGPP with
>    .OBJ ones generated by other C compilers and assembbmlers (MASM, TASM,...)?

No.  The formats are mostly incompatible in either direction.  See the
FAQ (v2/faq210b.zip) chapter 17 for lots of information on converting
this kind of code.  FYI, NASM (also available from SimTel) is an
assembler capable of producing COFF (the format DJGPP uses) code from
Intel syntax assembly.

BTW, case matters when using DJGPP; DJGPP object files end in '.o', not
'.O'.

> 2) Is it possible to create .LIB library files? If so, How is it done?

DJGPP is a port of GNU C, which uses '.a' as the suffix for libraries,
but otherwise yes.  You create a library with the 'ar' program, using
the following command:

ar rvs libmylib.a file1.o file2.o file3.o ...

Note that .LIB and .a files are not normally compatible, for the same
reasons mentioned above.  See the FAQ for possible occasions when they
are.

> 3) How can I access VRAM? Do I have to use any special segment? If so,
>    would this work?
> 
>          unsigned char *pointer;
> 
>          pointer = MK_FP(SelectorNumber, 0x000a0000);

This will not work because you're working in 32-bit protected mode, not
16-bit real mode.  32-bit means that you don't need any special kinds of
pointers when dealing with extended memory addresses (thus 'far',
'near', 'huge', 'MK_FP', 'FP_SEG', and 'FP_OFF' don't exist and aren't
needed).  Protected mode means that you can't just access any random
absolute memory location without crashing your computer.  The FAQ
specifically discusses graphics programming in chapter 10, including
three possible techniques for doing the above.

There is also a simple guide to getting started with graphics at
<http://www.rt66.com/~brennan/djgpp/how_to_access_vga.html>.

>    I'm sure I had some more questions, but I can't remember now, so...
> Thanks for any help you can give to me.

If you remember them, please ask.  But look in the FAQ first!  :)

-- 
John M. Aldrich <fighteer AT cs DOT com>                      

* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
  causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
  again.
* It doesn't necessarily do it in chronological order, though.
 
                                       --- Douglas Adams

- Raw text -


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