🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1244

"Divide error" with TC 2.0 program

#1244
From: Brent K. Barrett
Date: Thu, 14 Dec 1989 23:45
45 lines
1985 bytes
 I'm working on a TC 2.0 project, and something very frustrating
has come up.  I have a function, send(), that sends formatted
output to the screen via DMA or BIOS calls (internal variable).
Whenever I use a floating point format in my calls to send(), I get
a "Divide error" and a crash to the DOS prompt.
 
 Here's send():
/*
 *  send()
 */
void send(int x, int y, const char *str, ...)
{
    va_list argptr;
    char outstr[255];
 
    va_start(argptr, str);
    vsprintf(outstr, str, argptr);
    va_end(argptr);
    if (bool.bios)
        biossend(x, y, outstr);
    else
        memsend(x, y, outstr);
}
 
 I get no compiler/linker errors or warnings when compiling my
program (which I can not include for both size and security
reasons).  I'm using compact model, but have tried all other models
(that will hold the data) without change.  If I comment out the
first call to send() that uses the %f format, it will crash on the
next, and so forth.  I have linked mathc and emu, so that's not the
problem.
 
 I'm very frustrated and have lost about 4 days work over this
problem, so I really hope someone out there can at least tell me
*why* the "Divide error" happens.  Just that would probably be
enough to kick my brain into gear again and figure this thing out.
 
 Please E-mail your responses and I will post a summary.  Thank you
very much.

-- 
  ////////      Novucivitas: The Future of Citadel       //////// 
 ///    US 916 725 0674 3/12/2400 bps GEMAIL: B.K.BARRETT    /// 
////////          ..ames!pacbell!sactoh0!brent         //////// 
Technical Details
Message-ID: <2244@sactoh0.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!ucdavis!csusac!sactoh0!brent

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!ucdavis!csusac!sactoh0!brent
From: brent@sactoh0.UUCP (Brent K. Barrett)
Newsgroups: alt.msdos.programmer,comp.lang.c,comp.sys.ibm.pc
Subject: "Divide error" with TC 2.0 program
Message-ID: <2244@sactoh0.UUCP>
Date: 14 Dec 89 23:45:02 GMT
Organization: Sacramento Public Access, Ca. USA
Lines: 45