To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 3590
3589  |  3591
Subject: 
Re: NQC v. LegOS / size
Newsgroups: 
lugnet.robotics
Date: 
Tue, 9 Feb 1999 18:19:12 GMT
Viewed: 
1561 times
  
dave madden <dhm@paradigm.webvision.com> wrote:
Yes, the H8 divide instruction can only do (16 bits)/(8 bits), so GCC
calls a helper routine when you attempt to divide an integer by
another integer.  (Same thing with multiplication: the hardware can
only do (8 bits) x (8 bits) -> (16 bits), so GCC often calls a helper
function for that, too.)  Powers of two (division & multiplication)
can be converted to shifts, and multiplication/division by a constant
can often be turned into a combination of shifts and adds; GCC will do
that if it thinks the combination will be more efficient than a
generalized routine.

I haven't had need of any complicated math, so I haven't written the
helper routines; maybe Markus has some.  (Alternatively, I believe
Kekoa identified some math routines in the RCX ROM...it might be
possible to use those.)

Actually, I have the wrappers for GCC.  I have been busy with other stuff,
but I have been meaning to release my RCX code for a while now.  I spent
the morning packaging up my development environment, which now lives at:

http://graphics.stanford.edu/~kekoa/rcx/tools.html#Librcx

In particular, I provide the following files:

divhi3.c modhi3.c mulhi3.c udivhi3.c umodhi3.c
divsi3.c modsi3.c mulsi3.c udivsi3.c umodsi3.c

I also provide memcpy.c and memset.c, which are also used by GCC.

Have at it.

-Kekoa



Message is in Reply To:
  Re: NQC v. LegOS / size
 
=>From: Ben Laurie <ben@algroup.co.uk> =>... =>Markus L. Noga wrote: =>> Apart from the limitations imposed by H8 architecture (an 8/16 bit =>> platform with the usual constraints on integer length, available memory =>> and library functions), (...) (26 years ago, 9-Feb-99, to lugnet.robotics)

23 Messages in This Thread:










Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
14 hours ago
Custom Search

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