delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/15/19:33:37

From: "Gil Myers" <gmeyers AT logan DOT net>
Subject: Re: NASM - How to access vid ram inside DJ
Newsgroups: comp.os.msdos.djgpp
References: <33A083D9 DOT 11AC AT pukopn1 DOT puk DOT ac DOT za>
Organization: The Unknown Programmers
Message-ID: <01bc79c6$2ee9efe0$fd8033cf@pentium>
NNTP-Posting-Host: 207.51.128.253
Date: 15 Jun 97 19:44:43 GMT
Lines: 32
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

acebear AT pukopn1 DOT puk DOT ac DOT za wrote in article
<33A083D9 DOT 11AC AT pukopn1 DOT puk DOT ac DOT za>...
> How would you write a NASM generated COFF .o that will make it possible
> to directly access VGA memory (320x200) under DJGPP directly from an
> external, NASM coded asm prog without the usual slew of segment
> violation errors?
> 

Well,  since you're going to be in protected mode,  technically,  you can't
access
video RAM.  But before you say "Everyone else does!",  let me say that
there are
workarounds.

Workaround one is to  turn off protection.  This is described in the FAQ, 
and the
actual functions to do so are in the file SYS/NEARPTR.H.  This is very
dangerous.

A better way,  is to use the SYS/FARPTR.H functions.  These essentially use
the
FS register to access video RAM.

I'd suggest reading the FAQ,   and tinkering with the FARPTR functions to
see if
you can find a suitable workaround.

Another good place to look would be at Brennan's DJGPP + Games page, 
there's
a doc there describing the various ways you can get at video mem directly, 
and
safely. (You can get there from www.delorie.com )

- Raw text -


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