ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/08/03/19:10:57

From: "Jim Watters" <macemu AT emuunlim DOT com>
To: <djgpp AT delorie DOT com>
Subject: RE: Writing text to screen
Date: Sat, 3 Aug 2002 19:00:36 -0400
Message-ID: <010d01c23b41$9af53770$7fea2041@quantumstorm>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.2616
Importance: Normal
In-Reply-To: <CaW29.271751$WJf1.106172@news01.bloor.is.net.cable.rogers.com>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

I'm just a begineer too (after 3 years of sort of studying C/C++), but
here's a code snippet I studied a few days ago (I'm also interested in
using assembly). I'm working my way through a Micro$oft C Run-Time
Library Reference book to get a feel for C. Here's the DJGPP reference
page on this function:
http://www.delorie.com/djgpp/doc/libc/libc_455.html Hope this is what
you want. -Jim

Language: C
Compiler: DJGPP 2.03
Model: Small
Purpose: Print string to screen using int86 call
Target: DOS

#include <stdio.h>    /* include files */
#include <conio.h>
#include <dos.h>

#define VIDEO 0x10

void movetoxy(int,int); /* function prototype */

int main(void)
	movetoxy(35, 10);
	printf("Hello Again!\n");
	return 0;

void movetoxy(int x, int y)
	union REGS regs;
	regs.h.ah = 2;  /* set cursor position */
	regs.h.dh = y;
	regs.h.dl = x;
	regs.h.bh = 0;  /* video page 0 */
	int86(VIDEO, &regs, &regs);

-----Original Message-----
From: Brent Ritchie [mailto:britchieb212 AT rogers DOT com] 

    I could but I'm not that good. I've only been using C++ for about 3
years and I don't exactly understand how the libraries work. I'm used to
being protected from all the low level stuff.

- Raw text -

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