Code generated by OpenWatcom C using floating point numerics won't run on a PC-XT. - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Reply
 
Thread Tools Display Modes
 
Old 07-02-2012, 05:10 AM   #1 (permalink)
Newb Techie
 
Join Date: Jun 2012
Posts: 3
Default Code generated by OpenWatcom C using floating point numerics won't run on a PC-XT.

After I commented floating point code out of the program, the rest would run on the XT (V40, no FPU)

This simple program will build, but crashes the computer:

#include <math.h>
#include <stdio.h>

int main(void)
{
printf("%f\n",sqrt(2));
}

These compile-time options were used:
CFLAGS = -1 -fpc -ml -j -bt=dos -ohk -zp1 -os -zt32 -I$(%WATCOM)/h -D$(SYSTEM)

The program runs fine on anything 386+, with or without an FPU.

So, what am I doing wrong?
__________________

gauss1234 is offline   Reply With Quote
Old 07-16-2012, 03:28 AM   #2 (permalink)
Newb Techie
 
Join Date: Jun 2012
Posts: 3
Default Re: Code generated by OpenWatcom C using floating point numerics won't run on a PC-XT.

I solved my own problem. I had to use an older version of OpenWatcom. I tested several versions and found that v1.3 was the latest that handled 16-bit floating point code properly. During compile, only the -fpc option can be used, and not -fpi.

Secondly, to avoid the "Floating-point support not loaded" error, I had to run these commands:
cd [OpenWatcom folder]\lib286\dos
wlib graph -DUMMY
__________________

gauss1234 is offline   Reply With Quote
Old 07-16-2012, 10:02 AM   #3 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,506
Default Re: Code generated by OpenWatcom C using floating point numerics won't run on a PC-XT.

Sorry none of us could do more to help you out earlier; just none of us are probably familiar with OpenWatcom.

Glad you got it worked out though and thanks for posting your fix; hopefully it helps somebody else out as well.
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.EXE files >64k and built by OpenWatcom won't run on a PC-XT gauss1234 Programming 0 06-25-2012 06:21 AM
DWM.exe won't initialize, error code 0xc000007b styx888 Microsoft Windows and Software 1 09-18-2011 05:43 PM
Concert average answer to Floating Point Tyler1942 Programming 3 07-13-2011 02:00 AM
Binary Floating Point FullMonte84 Programming 0 09-30-2010 09:56 AM
NIC drivers won't load: code 31 Micscience Monitors, Printers and Peripherals 7 03-10-2005 05:03 PM



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 09:12 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.