2008/10/21, Rob Hamerling <[EMAIL PROTECTED]>:

> I don't know if memory usage was part of your argumentation to give
> print.jal a higher ranking than format.jal, but it is certainly part of
> mine!  Another argument is the more extensive functionality.
The reason I like print.jal better then format.jal has nothing to do
that I am only the author of the first one ;-) But:
- afaik print.jal is better quality (i don't know of any bugs)
- it contains the functionality I use often.

format.jal gives more control to the user (like fixed point output and
more control over the output in general) but has some strange behavoir
and minor bugs. All are possible to deal with in the application.
Fixing hower is a lot more complex and requires rewrite of the core of
the lib (maybe because I don't understand it good enough).

 > Then I replaced these by print_byte_hex() and that gave a growth of
> about 100 bytes.  Still significant but much better than format! And
> this is for only 3 calls to format_byte_hex().
It looks that both the lookup of the nibble and the double call to
process both nibbles (and not looping) is quite costly.
print_sbyte_decimal is however even more costly, since it actually
wraps to an universal routine that is able to handle sdwords, and that
maps to a routine that handles dwords.

If all is correct, not extra stack usage, but extra program size and
extra ram use (for calling params).

Optimising was however not my main concern while writing this code.
And if it was, my priority would be stack, ram and - lowest prio -
flash.
I thought of using global vars to store the device and other params.
This saves a few bytes of ram and flash, but would also block the
ability to use this code from both an ISR and normal program level.
An other option would be to create 6 _dec routines (signed en unsigned
byte, word and dword) that don't call other routines. Probably more
efficient on ram in all cases. Flash use will probably be less if only
one or two of these functions are used, but significant more when all
are used.

But... first wait and see if it turns out to be a real problem.

Joep

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to