Author Topic: default 4 byte integer  (Read 9631 times)

Offline fabio

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • bandaspilamberto
default 4 byte integer
« on: September 26, 2007, 08:18:12 AM »
In codewarrior In the project "console debug setting" there is a check box in "Coldfire Processor" that enable or disable 4byte integer. Default an integer use 4byte like in utasker project.
Can I pass to 2byte integer in the utasker project or I will have errors?

best regards
Fabio

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: default 4 byte integer
« Reply #1 on: September 26, 2007, 05:42:32 PM »
Hi Fabio

I must admit to now having experimented greatly with such settings (although I may modify the project to use register passing since it reduced code size a little - am am not sure that it is not a bit faster too (?) - there seems to be only one line of assember to modify and then it works..).

I believe that 2 byte integers should work. The project runs also on the 16 bit M9S12NE64 and int is used only for loop counters with quite small count values or for returning codes like 0 and 1, or -1 etc.
However I don't know whether there are any advantages doing this. Generally the processors work best with their natural integer value (same as the processor bus width) and a 4 byte integer is probably most efficient.

In any case there should be no harm in trying - just check the code size before and after to see what happens.

Do you have a particular reason to use 2 byte integer?

Regards

Mark

Offline fabio

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • bandaspilamberto
Re: default 4 byte integer
« Reply #2 on: September 28, 2007, 08:20:10 AM »
Hi Mark.
because the others libraries that I have included in my project and that was originally compiled for a 8bit micro, with the 4byte-integer, don't work...

It seems me too that utasker work also with the 2byte-integer, so I could use this option..but I am a little worry...

regards
Fabio


Offline fabio

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • bandaspilamberto
Re: default 4 byte integer
« Reply #3 on: November 13, 2007, 05:38:42 PM »
I can confirm that some parts of utasker doesn't go with deselection of 4-byte integer. for example the FTP
So I have corrected the others library

best regards
Fabio