floating point emulation in visual c++ 6.0

How to link in floating point emulation using visual c++ 6.0

Page 1 of 1

0 Replies - 1664 Views - Last Post: 05 January 2008 - 03:03 PM Rate Topic: -----

#1 crupib  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-January 08

floating point emulation in visual c++ 6.0

Posted 05 January 2008 - 03:03 PM

I need to compile and link in floating point emulation.
My compiler is visual c++ 6.0.
I checked all of the compiler and link options in the IDE but could not find anything. The following code is compiled and it is run on a 386 embedded system. This 386 does not have a floating point processor on it, so my
sin function and circle function do not work.
Any help would be greatly appreciated.

bc
--------------------------------------------------------------------------------------
#include <gdisp.h> /* LCD prototypes */
#include <gsimintf.h>
#include <gkeycode.h>
#include <stdio.h>
#include <math.h>
#include "gcolorcv.h"
#define PIVALUE 3.141592


int main(void)
{
	float f;
	GXT x; GYT y;
	int i;

	ginit();
	gselvp(0);
	gsetcvp(9,0,17,8);
	gputs("\n");
	gputs("line 1\n");
	gputs("line 2\n");
	gputs("line 3\n");
	gcrectangle(0,0,ggetvpw()-1, ggetvph()-1,G_BLACK);	
	gcrectangle(2,2,ggetvpw()-3, ggetvph()-3,G_BLACK);
	
	gselvp(1);
	gsetcvp(0,0,8,8);
	gcrectangle(0,0,ggetvpw()-1, ggetvph()-1,G_BLACK);	
	gcrectangle(2,2,ggetvpw()-3, ggetvph()-3,G_BLACK);
	gmoveto(3,ggetvph()/2);
	glineto(ggetvpw(),ggetvph()/2);
	gmoveto(3,ggetvph()/2);
	for (x = 3; x < ggetvpw()-3; x++)
	{
		f = PIVALUE*2.0;
		f *=x;
		f /= ggetvpw();
		y = (ggetvph())/2-(GYT)(sin(f) * (ggetvph())/2);
		glineto(x,y);
	}
	gselvp(2);
	gsetcvp(0,9,8,20);
	gcrectangle(0,0,ggetvpw()-1, ggetvph()-1,G_BLACK);	
	gcrectangle(2,2,ggetvpw()-3, ggetvph()-3,G_BLACK);
	for (i = 1; i < 4; i++)
		gcircle(20,20, 5*i,0);
	gselvp(3);
	gsetcvp(10,10,17,20);	
	gputs("How you doing!!");
	return 0;
}


This post has been edited by crupib: 06 January 2008 - 06:44 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1