The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.
IAR Compiler Output - perq87 - Sep 14 10:24:52 2009
Hi i'm using MSP430F449 in my project. While debugging i've seen this assembly output and
confused.
This line is a simple long to long addition. Is this output is normal? I think only last 2
asm lines enough for addition operation. Am i wrong?
fADCbuf[adcIndex] += (long)ADCMEM[adcIndex];
00B56A 4E4F mov.b R14,R15
00B56C 5F0F rla.w R15
00B56E 5F0F rla.w R15
00B570 4E4D mov.b R14,R13
00B572 5D0D rla.w R13
00B574 4D1C 0140 mov.w 0x140(R13),R12
00B578 4C0D mov.w R12,R13
00B57A E33D inv.w R13
00B57C 5D0D rla.w R13
00B57E 7D0D subc.w R13,R13
00B580 5C8F 0202 add.w R12,0x202(R15)
00B584 6D8F 0204 addc.w R13,0x204(R15)
Using IAR for MSP430 Compiler 4.20.1.20017 and tried all optimization options. Result is
the same.
Thank you.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: IAR Compiler Output - old_cow_yellow - Sep 14 10:28:59 2009
You got what you asked for.
Yes, the last 2 lines are for long + long. The other lines are for indexing and
casting.
--- In m...@yahoogroups.com, "perq87"
wrote:
>
> Hi i'm using MSP430F449 in my project. While debugging i've seen this assembly output
and confused.
>
> This line is a simple long to long addition. Is this output is normal? I think only last
2 asm lines enough for addition operation. Am i wrong?
>
> fADCbuf[adcIndex] += (long)ADCMEM[adcIndex];
> 00B56A 4E4F mov.b R14,R15
> 00B56C 5F0F rla.w R15
> 00B56E 5F0F rla.w R15
> 00B570 4E4D mov.b R14,R13
> 00B572 5D0D rla.w R13
> 00B574 4D1C 0140 mov.w 0x140(R13),R12
> 00B578 4C0D mov.w R12,R13
> 00B57A E33D inv.w R13
> 00B57C 5D0D rla.w R13
> 00B57E 7D0D subc.w R13,R13
> 00B580 5C8F 0202 add.w R12,0x202(R15)
> 00B584 6D8F 0204 addc.w R13,0x204(R15)
>
> Using IAR for MSP430 Compiler 4.20.1.20017 and tried all optimization options. Result is
the same.
>
> Thank you.
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: IAR Compiler Output - tintronic - Sep 14 12:59:00 2009
Remember, the MSP430 ALU is only one int (16 bit) of lenght, it can only do int + int.
You're doing long + long, that is (int<<16 + int) + (int<<16 + int).
Furthermore, you're using an index to a long. a long is 4 bytes of lenght, that means to
point to the long variable, you use an address that is a multiple of 4, so your index has
to be multiplied by 4.
Regards,
Michael K.
--- In m...@yahoogroups.com, "perq87"
wrote:
>
> Hi i'm using MSP430F449 in my project. While debugging i've seen this assembly output
and confused.
>
> This line is a simple long to long addition. Is this output is normal? I think only last
2 asm lines enough for addition operation. Am i wrong?
>
> fADCbuf[adcIndex] += (long)ADCMEM[adcIndex];
> 00B56A 4E4F mov.b R14,R15
> 00B56C 5F0F rla.w R15
> 00B56E 5F0F rla.w R15
> 00B570 4E4D mov.b R14,R13
> 00B572 5D0D rla.w R13
> 00B574 4D1C 0140 mov.w 0x140(R13),R12
> 00B578 4C0D mov.w R12,R13
> 00B57A E33D inv.w R13
> 00B57C 5D0D rla.w R13
> 00B57E 7D0D subc.w R13,R13
> 00B580 5C8F 0202 add.w R12,0x202(R15)
> 00B584 6D8F 0204 addc.w R13,0x204(R15)
>
> Using IAR for MSP430 Compiler 4.20.1.20017 and tried all optimization options. Result is
the same.
>
> Thank you.
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: IAR Compiler Output - perq87 - Sep 15 3:13:25 2009
Thank you very much for explanation.
Best regards
--- In m...@yahoogroups.com, "tintronic"
wrote:
>
> Remember, the MSP430 ALU is only one int (16 bit) of lenght, it can only do int + int.
You're doing long + long, that is (int<<16 + int) + (int<<16 + int).
> Furthermore, you're using an index to a long. a long is 4 bytes of lenght, that means to
point to the long variable, you use an address that is a multiple of 4, so your index has
to be multiplied by 4.
>
> Regards,
> Michael K.
>
> --- In m...@yahoogroups.com, "perq87" wrote:
> >
> > Hi i'm using MSP430F449 in my project. While debugging i've seen this assembly output
and confused.
> >
> > This line is a simple long to long addition. Is this output is normal? I think only
last 2 asm lines enough for addition operation. Am i wrong?
> >
> > fADCbuf[adcIndex] += (long)ADCMEM[adcIndex];
> > 00B56A 4E4F mov.b R14,R15
> > 00B56C 5F0F rla.w R15
> > 00B56E 5F0F rla.w R15
> > 00B570 4E4D mov.b R14,R13
> > 00B572 5D0D rla.w R13
> > 00B574 4D1C 0140 mov.w 0x140(R13),R12
> > 00B578 4C0D mov.w R12,R13
> > 00B57A E33D inv.w R13
> > 00B57C 5D0D rla.w R13
> > 00B57E 7D0D subc.w R13,R13
> > 00B580 5C8F 0202 add.w R12,0x202(R15)
> > 00B584 6D8F 0204 addc.w R13,0x204(R15)
> >
> > Using IAR for MSP430 Compiler 4.20.1.20017 and tried all optimization options. Result
is the same.
> >
> > Thank you.
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )