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 / 100
99  |  101
Subject: 
Re: cputw
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 30 Mar 1999 14:15:17 GMT
Viewed: 
1223 times
  
"Markus L. Noga" wrote:

Maybe we'd better opt for

unsigned char c=word&0xff;
cputc_...
cputc_...
c=word>>8;
cputc_...
cputc_...

instead - your patch doesn't work with my compiler version! This may
generate better assembly code, too, as word is already in a register.

By "doesn't work", I assume the patch applied successfully and your
compiler barfed with some sort of error message or generated incorrect
code.  That would tend to (at least slightly) indicate that the problem
that I was trying to fix may have been caused by a difference between
egcs-1.1.2 and egcs-1.1.1.

Whatever we come up that works is fine with me.  I am not married to my
code.
Actually, all I did was shuffle your statements around and change a
preincrement to a predecrement (in a different digit).  I did this as it
seemed more efficient than an earlier code replacement which I sent to
you personally (no patch generated) which was designed for portability at
the expense of efficiency.  Your suggested code snippet above looks like
a good compromise between the two approaches, though it still requires 2
4-bit shifts (compared to my 3 4-bit shifts).  I assume the 8 bit shift
will be coded by the compiler as a byte access.  I'll try it out when I
get back to where my RCX is.

It seems to me that LCD output functions are one place where squeezing
the last drop of efficiency out of the code isn't so important.  I've
been wrong before.



Message is in Reply To:
  cputw
 
Maybe we'd better opt for unsigned char c=word&0xff; cputc_... cputc_... c=word>>8; cputc_... cputc_... instead - your patch doesn't work with my compiler version! This may generate better assembly code, too, as word is already in a register. (25 years ago, 30-Mar-99, to lugnet.robotics.rcx.legos)

5 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