Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® Software > Disassembly View Shows incorrect source

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Disassembly View Shows incorrect source
Moderator:
JFMD

Post Reply
Follow this topic



Disassembly View Shows incorrect source

kabhijit posted on 01 Jun 2011 4:29 AM PST
Top Contributor
31 Forum Posts

Hi

I created a small function, defined in main.c as shown below:

int somefunc(int par1, int par2, int par3, int par4, int par5, int par6) { par1 = par1+par2; par1++; par3 = par1+par3; par3--; par5 = par5+par6+par3; par3 = par5; return (par3+par4); }

In main, I call this function with parameters shown below:

x = somefunc(16, 32, 64, 128, 256, 512);

 

However, in the disassembly view i see,

63:     x = somefunc(16, 32, 64, 128, 256, 512); 0x00000208 mov.w    r3, #100    ; 0x100  171:     }  172:     else  173:     {  174:         /* IMO doubler disabled */  175:         cyPmBackup.imo2x = CY_PM_DISABLED; 0x0000020C str    r3, [sp, #0] 0x0000020E mov.w    r3, #200    ; 0x200 0x00000212 str    r3, [sp, #4]  435:     {  436:         /* The IMO is ready to be source for Master clock */  437:         if(CY_PM_CLKDIST_MSTR0_REG != cyPmBackup.clkSyncDiv) 0x00000214 mov.w    r0, #10 0x00000218 mov.w    r1, #20 0x0000021C mov.w    r2, #40    ; 0x40 0x00000220 mov.w    r3, #80    ; 0x80 0x00000224 bl    14c <somefunc> 0x00000228 mov    r3, r0 0x0000022A str    r3, [r7, #c] ...   Clearly there is something wrong here - why are the lines 171 - 175 and lines 435 - 437 showing up? They have something to do with the internal oscillator (IMO) iirc. The assembly code, btw, is doing the correct things... The device is a PSoC 5, software is PSoC Creator V1 (Production). This is just one example - there may be others that I have not seen.

Any ideas anyone?

~Abhijit




Re: Disassembly View Shows incorrect source

kabhijit posted on 01 Jun 2011 04:48 AM PST
Top Contributor
31 Forum Posts

Re - posting for better readability...

Hi

I created a small function, defined in main.c as shown below:

int somefunc(int par1, int par2, int par3, int par4, int par5, int par6) 
{ 
par1 = par1+par2; 
par1++; par3 = par1+par3; 
par3--; par5 = par5+par6+par3; 
par3 = par5; 
return (par3+par4); 
}

In main, I call this function with parameters shown below:

x = somefunc(16, 32, 64, 128, 256, 512);

 

However, in the disassembly view i see,

63:     x = somefunc(16, 32, 64, 128, 256, 512); 
0x00000208 mov.w    r3, #100    ; 0x100  
171:     }  
172:     else  
173:     {  
174:         /* IMO doubler disabled */  
175:         cyPmBackup.imo2x = CY_PM_DISABLED; 
0x0000020C str    r3, [sp, #0] 
0x0000020E mov.w    r3, #200    ; 
0x200 0x00000212 str    r3, [sp, #4]  
435:     {  
436:         /* The IMO is ready to be source for Master clock */  
437:         if(CY_PM_CLKDIST_MSTR0_REG != cyPmBackup.clkSyncDiv) 0x00000214 mov.w    r0, #10 
0x00000218 mov.w    r1, #20 
0x0000021C mov.w    r2, #40    ; 0x40 
0x00000220 mov.w    r3, #80    ; 0x80 
0x00000224 bl    14c <somefunc> 
0x00000228 mov    r3, r0 0x0000022A 
str    r3, [r7, #c] ...   
 
Clearly there is something wrong here - why are the lines 171 - 175 and lines 435 - 437 showing up?
They have something to do with the internal oscillator (IMO) iirc.
The assembly code, btw, is doing the correct things...
The device is a PSoC 5, software is PSoC Creator V1 (Production).
This is just one example - there may be others that I have not seen.
Any ideas anyone?

 

Also, I have verified this by starting up the debugger and single stepping through the assembly - the screenshot is attached. The instructions at 0x218 to 0x220 save the parameters to be passed to the function and the line at 0x224 is the actual branch...

Hope that clarifies the problem...

Thanks,

~Abhijit



Re: Disassembly View Shows incorrect source

kabhijit posted on 30 Nov 2011 06:02 AM PST
Top Contributor
31 Forum Posts

*bump*

Anyone?

~Abhijit



Re: Disassembly View Shows incorrect source

Bob Marlowe posted on 30 Nov 2011 06:34 AM PST
Top Contributor
1768 Forum Posts

Do not be hasty....

 

Bob



Re: Disassembly View Shows incorrect source

Bob Marlowe posted on 30 Nov 2011 06:58 AM PST
Top Contributor
1768 Forum Posts

I just copied your pgm and had a look at main.lst. Here everything looks quite O.K.

Did you already try (sorry to ask) a re-boot and a re-build?

Bob

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20