To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 199
198  |  200
Subject: 
Floating point emulation
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 5 May 1999 20:15:09 GMT
Viewed: 
1407 times
  
I succeeded in using (emulated) floats in a legOS program. Here are some
instructions in case some of you want/need to try 32 bit FP emulation.

First of all I must point out that I have no merit at all in having got this
result, a part from having stressed a lot the right persons to get help :-)

Thanks to John A. Tamplin who gave me a lot of info and to Marco Beri who
solved the last problems and tested the solution on his legOS installation.

I compile legOS on a Windows PC, so I have cygwin installed. I tried to make
these instruction easy to follow for people not particularly at ease with gnu
tools (I am one of them).

Instructions
------------

1. FP emulation is in the "fp-bit.c" file that compiles into "libgcc.a". Find
the proper "libgcc.a" in your cross compiler egcs path. Mine is in:
..\cygnus\cygwin-b20\H-i586-cygwin32\lib\gcc-lib\h8300-hms\egcs-2.91.57
an its size is 339458.

2. copy it in your legOS\lib directory (in the same place where you find
libc++.a, libc.a, libmint.a).

3. In your Makefile modify the LIBS= line appending "-lgcc" to its end:
LIBS= -lc -lmint -lc++ -lgcc

4. In your Makefile modify the KSOURCES= line adding "memcpy.c":
KSOURCES=kmain.c mm.c systime.c tm.c semaphore.c conio.c lcd.c \
         memcpy.c direct-ir.c direct-motor.c direct-sensor.c direct-sound.c

5. Find "memcpy.c" in your legOS\lib\c directory and copy it to your main legOS
directory (the same where you find "direct-motor.c", "direct-ir.c" etc.)

6. Now you can declare and use 32 bit float vars in your source.

Good luck and have fun

Mario

PS: I would be surprised if this solution couldn't be refined by some of you
legOS very experts.



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR