www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/28/17:27:08

From: Anders =?iso-8859-1?Q?L=F6vgren?= <lespaul AT algonet DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: writing directly to video card
Date: Mon, 27 Dec 1999 14:14:25 +0100
Organization: Telenordia
Lines: 36
Message-ID: <38676631.2B5984E3@algonet.se>
References: <8424q2$ocr$1 AT planja DOT arnes DOT si>
NNTP-Posting-Host: aristotle.algonet.se
Mime-Version: 1.0
X-Trace: cubacola.tninet.se 946300339 4275 194.213.74.200 (27 Dec 1999 13:12:19 GMT)
X-Complaints-To: abuse AT algo DOT net
NNTP-Posting-Date: 27 Dec 1999 13:12:19 GMT
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Matej wrote:
> 
> hello,
> can someone point me to any tutorial (or just tell me here what to do) if I
> want to do something similar to functions in conio.h? e.g. I'd like to fill
> the last character on the screen (80*25) so that it wouldn't jump into next
> line?
> Thanks,
> Matej

Hi

This isn't writing directly to the video memory, but it address your
last question:
// outputs a character at the current cursor position using the
// video BIOS to avoid the scrolling of the screen when writing
// to location (80,25).
void writechar(char ch, unsigned int attr)
{
  asm {
    mov ah, 9h             // interrupt 0x10 sub-function 9
    mov al, ch             // character to be output
    mov bh, 0              // video page
    mov bl, attr           // video attribute
    mov cx, 1h             // repetition factor
    int 10h                // output the char
  }
}

This hasn't been tested and uses intel assembler syntax 
(DJGPP uses AT&T), but should give an impression of how
it can be done. More on BIOS calls is avlible in Ralph Browns 
Interrupt list, along with some sample codes on how to move cusor,
access video-memory and that stuff.

Anders L

- Raw text -


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