Mail Archives: djgpp/1995/10/03/04:04:29
Xref: | news-dnh.mv.net comp.os.msdos.djgpp:2342
|
Path: | news-dnh.mv.net!mv!news.sprintlink.net!simtel!col.hp.com!bubba.ucc.okstate.edu!wizard.uark.edu!engr.engr.uark.edu!alh
|
From: | ALAN L HIGHTOWER <alh AT engr DOT engr DOT uark DOT edu>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Help: Direct video/inline asm
|
Date: | Sun, 1 Oct 1995 19:22:52 -0500
|
Organization: | University of Arkansas
|
Lines: | 47
|
References: | <44iqr1$r6s AT kelly DOT teleport DOT com>
|
Nntp-Posting-Host: | engr.engr.uark.edu
|
To: | djgpp AT sun DOT soe DOT clarkson DOT edu
|
Dj-Gateway: | from newsgroup comp.os.msdos.djgpp
|
On 30 Sep 1995, Jonathan Nix wrote:
> This is rather premature, sorry. I'm sure theres a way, but when I;
>
> char *vidmem=(char *)0xA0000000L;
All the information you need is in the FAQ, when puzzled, read it
first... it's a pretty good source of information.
As to above problem, I'm not sure where you got 0xA0000000 from, other
than in real mode vidmem is a000:0000, an entirely different thing.
In version 1.12 all of the VGA cards RAM is page mapped linearly at
address 0xd0000000 and it performs the bank switches on the fly via
exception handling.
In version 2.0, the linear mapping hack can't be done due to the way
protection is handled under DPMI. To access the video window you must
reference it via offset 0xa0000 relative to the DOS low memory selector.
(Which can be obtained through a DPMI call or the _go32_info_block).
> I can't figure out how to use an inline assembly block either, I
> can do interrupt calls, but bios is waaaay too slow.
I would suggest looking at the as.tex that comes with DJGPP for the
differences between GNU as and other assemblers. Inline asm is done
though the asm("") function. Whatever is included between the quotes
gets spewed out in the assembly stream when gcc finishes. The long
format is:
asm( " opword opreands \n\
.... .... \n\
opword opreands \n"
: "=a" ( foo ), .... /* outputs: ax gets loaded into foo */
: "d" ( bar ), .... /* inputs: bar gets loaded into dx */
: "eax", "edx", .... /* clobbered regs: protects contents of eax, edx */
);
as an example
> Any information would be much abliged, I will search the
> doc's, but I am so excited about programming in DOS for
> both platforms.
good luck.
- Raw text -