delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/11/08:30:57

From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: int 16h/func 00h
Date: 10 Nov 1997 06:01:06 GMT
Organization: The National Capital FreeNet
Lines: 26
Message-ID: <6467v2$e5u@freenet-news.carleton.ca>
References: <3463E3D8 DOT 968C53AE AT geocities DOT com>
Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
NNTP-Posting-Host: freenet3.carleton.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

 (ionicis AT geocities DOT com) writes:
> Ok, what EXACTLY does that interrupt function do?  I need to know
> EXACTLY what it does when called.  I'm very new to keyboard interrupts,
> so below is a little code snippet I wrote as a test program for the
> keyboard interrupt functions.  I want the program to prompt the user via
> the first printf(), and then call get_key(), and when the user presses a
> key (because I assume that int6h/00h waits for the user to hit a key,
> then returns the data), and then it tells the user what key was hit.
> For some reason, the first printf() dosen't execute until the user hits
> a key.  When a key is hit, both printf()s execute.  Why is this?  BTW,
> I'm using DJGPP.

Buffered stdout. Put \n of fflush(stdout) before you go looking for the
key, after printing "press a key".

>         printf("Press a key");
  printf ("Press a key\n");
-- OR --
  printf ("Press a key"); fflush(stdout);

--
    .*.  Where feelings are concerned, answers are rarely simple [GeneDeWeese]
 -()  <  When I go to the theater, I always go straight to the "bag and mix"
    `*'  bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh

- Raw text -


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