[Icc-430] Comment on ICC Code

Wolfgang Schulze Wolfgang.Schulze at myrealbox.com
Sun Mar 18 10:13:55 PST 2007


Storing into a pointer is done by using more registers than necessary.

For the follwing construction
*s++='-'
the incrementing of the pointer is done before the moving of the
variable. This forces the use of  another register. It would be better
to move first and then to increment.

Example of some code in a list file:

           ;     if (Num<0) {Num=-Num;*s++='-';}

0136 81930000          cmp #0,0(R1)

013A 0A34              jge L19

013C                   .dbline 113

013C                   .dbline 113

013C B1E0FFFF0000      xor #65535,0(R1)

0142 91530000          add #1,0(R1)

0146                   .dbline 113

0146 0B44              mov R4,r11

0148 1453              add #1,R4

014A FB402D000000      mov.b #45,0(r11)



It would be shorter for last part to use

mov, b #45,0(r4)

add #1,R4


Wolfgang



More information about the Icc-430 mailing list