|
|
View previous topic :: View next topic |
Author |
Message |
RKnapp
Joined: 23 Feb 2004 Posts: 51
|
PCWH is generating code at 0x00 -- why? |
Posted: Tue Mar 16, 2004 6:26 pm |
|
|
Friends,
I don't actually know if this is a problem or not, but CCS Support has not responded to my question about this topic so maybe someone here knows the answer.
My .tre file shows that main is calling a number of recognizable functions I wrote, but also a mysterious "??0??"
Code: | main 0/438 Ram=4
³ ÃÄ??0??
³ ÃÄwhystart 0/156 Ram=0
³ ÃÄinitialz 0/324 Ram=7 |
and so forth. I sometimes garner complaints, "code is outside any section", and it is sometimes shown on the stack with complaints.
The symbol table (RAM) seems innocuous:
000 @SCRATCH
000 x_ErrCodes
001 @SCRATCH
001 _RETURN_
002 @SCRATCH
003 @SCRATCH
004 @SCRATCH
005 @INTERRUPT_AREA
006 @INTERRUPT_AREA
007 @INTERRUPT_AREA
008 @INTERRUPT_AREA
009 @INTERRUPT_AREA
00A @INTERRUPT_AREA
00B @INTERRUPT_AREA
00C @INTERRUPT_AREA
00D @INTERRUPT_AREA
00E @INTERRUPT_AREA
00F @INTERRUPT_AREA
010 @INTERRUPT_AREA
011 @INTERRUPT_AREA
012 @INTERRUPT_AREA
013 @INTERRUPT_AREA
014 @INTERRUPT_AREA
015 @INTERRUPT_AREA
016 rs232_errors
017-0E0 x_RTflags
0E1-0E7 x_RTtime
and so forth, so I don't observe that this "??0??" "code" is being placed in RAM. But for sure, there IS code in ROM at location 0; here is part of the .lst file:
CCS PCH C Compiler, Version 3.187, 22420
Filename: C:\KNAPP\NTEK_HDV100\RAK_8720\voterhdv.LST
ROM used: 2372 (1%)
Largest free fragment is 0
RAM used: 344 (9%) at main() level
355 (9%) worst case
Stack: 4 worst case (2 in main + 2 for interrupts)
*
0000: GOTO 0790
*
0008: MOVWF 05
000A: MOVFF FD8,06
000E: MOVF FE9,W
0010: MOVWF 07
0012: MOVF FEA,W
0014: MOVWF 08
0016: MOVF FE1,W
0018: MOVWF 09
001A: MOVF FE2,W
001C: MOVWF 0A
001E: MOVF FD9,W
0020: MOVWF 0B
0022: MOVF FDA,W
0024: MOVWF 0C
0026: MOVF FF3,W
0028: MOVWF 14
002A: MOVF FF4,W
002C: MOVWF 15
002E: MOVF FE0,W
0030: MOVWF 0D
0032: MOVLB 0
0034: MOVF 00,W
0036: MOVWF 0F
0038: MOVF 01,W
003A: MOVWF 10
003C: MOVF 02,W
003E: MOVWF 11
So -- what is going on? I usually use this thing #device icd=true, so is this somehow affliated with the debugger?
I realize that there is a help item called: "Why does the .LST file look out of order?" which states:
Code: |
1. Stray code near the top of the program is sometimes under what looks like a non-executable source line.
Some of the code generated by the compiler does not correspond to any particular source line. The compiler will put this code either near the top of the program or sometimes under a #USE that caused subroutines to be generated.
|
But...... at certain points, the compiler complains about this ??0?? code, so something, perhaps unimportant, seems awry. Just hearing "don't worry about it" would be an okay answer. I'm just disconcerted that whatever this is, could come back to bite. So any insight you can lend would be appreciated.
Robert
ps. Another dumb question: the .tre file shows entries such as:
initialz 0/324 Ram=7
What are the 0 and the 324? I assume 7 bytes of RAM are consumed. Right? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Mar 18, 2004 12:27 am |
|
|
Quote: | My .tre file shows that main is calling a number of recognizable
functions I wrote, but also a mysterious "??0??" |
Let's compare the code generated by PCM and PCH with two
absolutely minimal programs. The two compiler versions used
in this test were PCH 3.178 and PCM 3.184.
Code: |
#device PIC16F877
void main()
{
} |
This program creates the following .TRE file.
I have taken the liberty of changing the DOS "business graphics"
characters into dashes.
Code: |
--TEST
--MAIN 0/23 Ram=1
--@CINIT (Inline) Ram=0
|
Now let's do it for PCH.
Code: |
#device PIC18F458
void main(void)
{
}
|
That source code generates this .TRE file.
Code: | --TEST458
--main 0/20 Ram=0
--??0?? |
One likely conclusion is that the ??0?? is the "CINIT" code for PCH.
Why doesn't CCS use the proper label ? -- I don't know.
Quote: | I sometimes garner complaints, "code is outside any section",
and it is sometimes shown on the stack with complaints.
But...... at certain points, the compiler complains about this ??0?? code,
so something, perhaps unimportant, seems awry |
I have never seen this. What PIC are you using, and what's
your version of the compiler ? |
|
|
RKnapp
Joined: 23 Feb 2004 Posts: 51
|
|
Posted: Sat Mar 20, 2004 7:13 pm |
|
|
PCM,
Thanks for looking at this! I don't know whether to worry or not, but I'm generally concerned whenever CCS has a shoelace not tied.
- I'm using PIC18F8720. My compiler version is 3.187, but as you noticed, this occurs in 3.184 as well. You didn't say whether you were using ICD-U40, but I am, and was wondering if this is somehow affiliated with the problem.
Hmm ... ???
Thanks,
Robert |
|
|
|
|
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
|