public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Newbie/CS Student - VGA question
@ 2002-01-14 22:29 Jonathan Simms
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Simms @ 2002-01-14 22:29 UTC (permalink / raw)
  To: gcc-help

Hi everybody,

This is my first time posting to this list, so please be gentle...

I'm taking "Advanced C" and my professor is running me through the
graphics BIOS calls. The only problem is that the book we're using as a
language reference is for Borland's Turbo C 2.01...but i'm doing my
compilation with gcc.


Being new to this, i know that i'm about to ask one of those sprawling,
"i don't know a thing about what i'm talking about" questions, but if
some kind soul out there could just aim me in a direction, I'd
appreciate it.

Where can i look for information/tutorials/etc. about writing code that
makes use of old-school, 320x200 VGA ROM-BIOS calls? 

one of the program examples uses the following:

#include "dos.h"
...
main()
{
    union REGS regs;
    int row, col;
    for(row=0; row < MAXR; row++)
        for(col=0; col < MAXC; col++)
        {
            regs.h.ah = WDOT;               /* write dot service */
            regs.x.dx = row;                /* row in DX */
            regs.x.cx = col;                /* column in CX */
            regs.h.al = col/80;             /* col chng every 80 rows */
            regs.h.bh = 0;                  /* page number */
            int86(VIDEO, &regs, &regs);     /* call video services */
        }
}


What library/include files define "REGS"? 

I'm totally lost, so any leads would be most helpful.

Thanks for your time,
Jonathan


----------------------------------------------
Jonathan Simms
Embassy Networks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Newbie/CS Student - VGA question
  2002-01-14 23:06 ` Rupert Wood
@ 2002-01-15  4:46   ` Jonathan Simms
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Simms @ 2002-01-15  4:46 UTC (permalink / raw)
  To: 'Rupert Wood'; +Cc: gcc-help

Rupert,

Thanks a lot! I also found the following site that was very useful
http://sf.znet.com/~vhold/FreeVGA/home.htm - the FreeVGA homepage. 

Very extensive and easy to understand...well...read :-)

Thanks again!
Jonathan

-----Original Message-----
From: Rupert Wood [mailto:me@rupey.net] 
Sent: Tuesday, January 15, 2002 2:05 AM
To: 'Jonathan Simms'
Cc: gcc-help@gcc.gnu.org
Subject: RE: Newbie/CS Student - VGA question



Jonathan Simms wrote:

> I'm taking "Advanced C" and my professor is running me through the 
> graphics BIOS calls.

? The graphics BIOS calls are target and OS specific and, to all intents
and purposes, obsolete. (Not what I'd expect from 'Advanced C'.)

> Where can i look for information/tutorials/etc. about writing code 
> that makes use of old-school, 320x200 VGA ROM-BIOS calls?

The classic free DOS programming guide would be "Ralf Brown's interrupt
list": just throw that into a search engine. That should, amongst many
other things, contain documentation of all the VGA interrupts (int
0x10).Most, however, just use the BIOS to set mode and then poke to
video memory directly. For that, you probably want search-engine for
'"mode x" vga'.

> #include "dos.h"
:
> What library/include files define "REGS"?

That's probably in dos.h. It'd be a vendor extension.

You can do all of the above (and more, and in a more efficient way)
using GCC's inline assembler - see section 5 of the GCC manual.

Good luck,
Rup.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Newbie/CS Student - VGA question
       [not found] <616BE6A276E3714788D2AC35C40CD18D2C5981@whale.softwire.co.uk>
@ 2002-01-14 23:06 ` Rupert Wood
  2002-01-15  4:46   ` Jonathan Simms
  0 siblings, 1 reply; 3+ messages in thread
From: Rupert Wood @ 2002-01-14 23:06 UTC (permalink / raw)
  To: 'Jonathan Simms'; +Cc: gcc-help

Jonathan Simms wrote:

> I'm taking "Advanced C" and my professor is running me through the
> graphics BIOS calls.

? The graphics BIOS calls are target and OS specific and, to all intents
and purposes, obsolete. (Not what I'd expect from 'Advanced C'.)

> Where can i look for information/tutorials/etc. about writing
> code that makes use of old-school, 320x200 VGA ROM-BIOS calls?

The classic free DOS programming guide would be "Ralf Brown's interrupt
list": just throw that into a search engine. That should, amongst many
other things, contain documentation of all the VGA interrupts (int
0x10).Most, however, just use the BIOS to set mode and then poke to
video memory directly. For that, you probably want search-engine for
'"mode x" vga'.

> #include "dos.h"
:
> What library/include files define "REGS"? 

That's probably in dos.h. It'd be a vendor extension.

You can do all of the above (and more, and in a more efficient way)
using GCC's inline assembler - see section 5 of the GCC manual.

Good luck,
Rup.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-01-15 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-14 22:29 Newbie/CS Student - VGA question Jonathan Simms
     [not found] <616BE6A276E3714788D2AC35C40CD18D2C5981@whale.softwire.co.uk>
2002-01-14 23:06 ` Rupert Wood
2002-01-15  4:46   ` Jonathan Simms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).