Date: Mon, 10 Jan 2000 12:25:33 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Str|mberg cc: djgpp AT delorie DOT com Subject: Re: The endless int31 hooking debugging continued In-Reply-To: <85a7so$9kn$1@news.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 9 Jan 2000, Martin Str|mberg wrote: > : How about using _farpokeb, then? It's inline assembly, and doesn't > : use the stack. You could write the characters with it one by one. > : Clumsy, but works. > : > : Actually, you could even use the assembly instructions from _farpokeb > : inlined in your code. > > The problem I have isn't with the loop or such, but to get something > out to video memory. I have some kind of basic understanding of > assembly, but knows very little about PC hardware. The following snippet puts a red letter 'a' on lightgray background in the leftmost, topmost corner of the screen (WARNING: UNTESTED CODE!): _farpokeb (_dos_ds, 0xb8000, 'a'); _farpokeb (_dos_ds, 0xb8001, 0x74); Each character on the screen takes two bytes in the video memory: the first holds the character's code, the second its video attribute byte. The attribute byte (here, 0x74) holds the background color in its high nibble and the foreground color in its lower nibble. The color codes begin at 0 and go up in the order the colors are listed in the "enum COLOR" on conio.h. To put 'a' in the rightmost lower corner, use 0xb8000 + 160*24 + 158 as the second argument to _farpokeb (assuming 80x25 text screen).