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 / 2721
2720  |  2722
Subject: 
Re: anyone know how to check free space on RCX?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Fri, 12 Jul 2002 21:15:31 GMT
Viewed: 
2476 times
  
In lugnet.robotics.rcx.legos, Jochen Hoenicke writes:
According to config/h8300/h8300.h in the gcc sources, int is 32bit
for the h8 cross compiler.

My sources (gcc-3.0) say:
#define INT_TYPE_SIZE           (TARGET_INT32 ? 32 : 16)

A short experiment revealed that sizeof(short)=sizeof(int)=2,
sizeof(long)=4.  So int is normally 16bit.  Only with the switch
"-mint32" I get 32 bit ints.  This is with a self-compiled gcc-3.0.

Thanks for conducting the test... being 200+ miles away from my RCX this was
bugging me :).  My sources (gcc-2.95.2) have the same #define... but with
the following about 120 lines earlier:

/* Make int's 32 bits. */
#define TARGET_INT32 (target_flags & 8)

I scanned this quickly, and took the comment at face value.  Appologies.  In
fact its a test again the extern int 'target_flags', which I haven't tracked
down yet.

Many places in legOS use int where they only want a 16 bit value.


Precisely why I thought that I was missing something :)

If you want to extract the ROM ;) see
http://graphics.stanford.edu/~kekoa/rcx/

I'm trying to avoid that... I'm still trying to learn the kernel sources ;)


I would guess that it just prints 9999 if the number is too big to
fit, otherwise it prints the decimal value.

That seems to be the consensus from others who have tested.  If anyone wants
to display free mem as a decimal int, I have a scroll function I wrote as
part of my dbg library I can post when I get home Monday.  Scrolls messages
across the LCD display to overcome the 5 char limit.

Thanks for the clarifications on the ints, Jochen.



Message is in Reply To:
  Re: anyone know how to check free space on RCX?
 
(...) My sources (gcc-3.0) say: #define INT_TYPE_SIZE (TARGET_INT32 ? 32 : 16) A short experiment revealed that sizeof(short)=sizeof(int)=2, sizeof(long)=4. So int is normally 16bit. Only with the switch "-mint32" I get 32 bit ints. This is with a (...) (22 years ago, 12-Jul-02, to lugnet.robotics.rcx.legos)

13 Messages 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