🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3625

putting chars back to keyboard buf.. Round 2..

#3625
From: ARIT ISMAIL
Date: Thu, 12 Nov 1992 18:00
52 lines
1753 bytes
Hi,

First, thanks to those who replied to my last buffer question.!!
Now, here is my code..

void
PushBackChar(char aChar)
{
    unsigned int       temp2;
    unsigned int far  *tail = (unsigned int far *)(0x0040L << 16 |
                                                   0x001CL);
    unsigned int far  *head = (unsigned int far *)(0x0040L << 16 |
                                                   0x001AL);

    temp2 = *tail;
/* let's go to next box, see where we are.!*/
    temp2 += 2;

    if (temp2 <= 0x3E)
        goto still_got_space;
    else
    {   /* go back to start*/
        temp2 = 0x1E;
        temp2 += 2;
    }

still_got_space:
    if ((*head) == temp2)
        goto cant_push;
    else                        /* don't care about ext. keys */
    *((int far *)(0x0040L << 16 | (long)(temp2 - 2))) =
                                              (unsigned)aChar;

                                /* update tail */
    *((unsigned far *)(0x0040L << 16 | 0x001CL)) = temp2;

cant_push:;
 /* trash */

};



this code works just fine(Well.! not always!!..), but there is a
problem. Sometimes, DOS shell reads whatever I pushed recursively
'till I do Ctrl-C (I am using this to push some strings back to DOS
shell from a tsr). Does anybody know/see what the problem is?
 Thanks in advance.

iarit@slate.mines.colorado.edu

 
Technical Details
Message-ID: <1992Nov12.180037.62744@slate.mines.colorado.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!asuvax!ncar!vexcel!copper!slate!iarit

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!asuvax!ncar!vexcel!copper!slate!iarit
From: iarit@slate.mines.colorado.edu (ARIT ISMAIL)
Newsgroups: comp.os.msdos.programmer
Subject: putting chars back to keyboard buf.. Round 2..
Message-ID: <1992Nov12.180037.62744@slate.mines.colorado.edu>
Date: 12 Nov 92 18:00:37 GMT
Organization: Colorado School of Mines
Lines: 52