Mail Archives: djgpp/2009/05/21/10:00:24

X-Authentication-Warning: mail set sender to djgpp-bounces using -f
From: =?ISO-2022-JP?B?GyRCPi44UUBnGyhC?= <foxapple AT gmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: An interrupt drived uart program dead
Date: Thu, 21 May 2009 06:49:07 -0700 (PDT)
Lines: 26
Message-ID: <>
References: <dcff139d-32b8-4f22-ab4a-6f7e78f81324 AT c18g2000prh DOT googlegroups DOT com>
Mime-Version: 1.0
X-Trace: 1242913747 26214 (21 May 2009 13:49:07 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Thu, 21 May 2009 13:49:07 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info:; posting-host=;
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/530.9 (KHTML, like Gecko) Chrome/ Safari/530.9,gzip(gfe),gzip(gfe)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

The bug is found. Rod Pemberton is right. The do-while loop in the
commISR never exits. I miss a "break" statement after "txIdle = true;"
in the do-while loop. the correct code block is follow:
     do {
         if (queueSize > 0)
            byte data = writeQueue[queueHead];
            queueHead = (queueHead + 1) % QUEUE_CAPABILITY;
            queueSize --;
            outportb(baseAddress + OFFSET_THR, data);
            txIdle = false;
            txIdle = true;
            break;             // this statement missed so can't exit
the do-while loop.
         lsr = inportb(baseAddress + OFFSET_LSR);
      } while((lsr & (LSR_THRE | LSR_TEMT)) != 0);

Very thanks for everybody's help. All suggestion give me the good idea
for the future develop in DOS.
God bless you all ! :-D

- Raw text -

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