CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Missing address for a goto in the C/ASM Listing

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Herbert



Joined: 20 Jul 2008
Posts: 32
Location: Brisbane, Australia

View user's profile Send private message

Missing address for a goto in the C/ASM Listing
PostPosted: Fri Dec 26, 2008 9:07 pm     Reply with quote

Does anybody have any thoughts on the following observations, please. Compiler is PCWH V4.079, developing for a 18F2620.

After a successful compile the C/ASM listing shows the following (with a lot of gumpf taken out)
Code:

1034:  GOTO   1058
....................         case AAA       : Switch_to_AA();
1038:  CALL   0264
....................                  break;
103C:  MOVLB  3
103E:  BRA    1054
....................         case BBB    : Switch_to_BB();
1040:  BRA    0FE6
....................                  break;
1042:  MOVLB  3
1044:  BRA    1054
....................         case CC      : Switch_to_CCC();
1046:  BRA    0FFC
....................                  break;
1048:  MOVLB  3
104A:  BRA    1054
....................         case External_Port : Switch_to_External();
104C:  BRA    1012
....................                  break;
104E:  MOVLB  3
1050:  BRA    1054
1052:  MOVLB  3
....................       }
....................    }   
1054:  MOVLB  0
1056:  RETLW  00
....................     

....................    {
....................    int8 DDD[6];
.................... 
....................       If ( GGG < HHH) 
*
1084:  MOVF   53,W
1086:  SUBLW  09
1088:  BNC   10D2

The GoTo refers to an address 1058, which does not exist in the listing. The addresses jump from 1056 to 1084, with nothing in between. A search of the C/ASM listing only shows a reference to it in the goto.

Also notice that addresses in the rest of the listing are not always sequential. Blocks of addresses can be in totally different positions, is this normal?

Trying to chase a problem where the position of a bit of code determines how other bits of code execute. I expect its a pointer problem, but seeing a listing with missing addresses is a bit of a concern.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Dec 26, 2008 11:30 pm     Reply with quote

To see all the CCS library code, comment out the #nolist statement near
the start of the 18F2620.h file. Example:
Quote:
//////// Standard Header file for the PIC18F2620 device ///
#device PIC18F2620
// #nolist

Then re-compile and look at the .LST file again.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

Re: Missing address for a goto in the C/ASM Listing
PostPosted: Sat Dec 27, 2008 12:02 am     Reply with quote

Herbert wrote:
Also notice that addresses in the rest of the listing are not always sequential. Blocks of addresses can be in totally different positions, is this normal?
Yes. The compiler will reorder code to achieve a more optimal arrangement.
_________________
Andrew
Herbert



Joined: 20 Jul 2008
Posts: 32
Location: Brisbane, Australia

View user's profile Send private message

PostPosted: Sun Dec 28, 2008 7:09 pm     Reply with quote

Thanks very much PCM and Andrewg. Feel better now! It starts to make more sense.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group