|
|
View previous topic :: View next topic |
Author |
Message |
stoppsm
Joined: 19 Jan 2005 Posts: 2
|
? in a text string "xxx ?" compiles to "xxx ? |
Posted: Wed Jan 19, 2005 3:08 am |
|
|
Have a problem with using a question mark "?" in a text string.
Example source: printf(lcd_putc, "ready ?"); // remark ready?
Code compiled:
List file: printf(lcd_putc, "ready ??); // remark ready??
The list file duplicates the '?' always and if there was a character after this that is overwritten too ie ?" = ??.
This issue occurs at all ? characters and usually has no effect on the text string printed, however occasionally it does corrupt the text message.
Can anyone advise why this happens and a solution to the issue.
CCS version 3.25 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 19, 2005 8:35 am |
|
|
We can check this problem for you if we know the correct version
number. There is no version "3.25". See the list of versions here:
http://www.ccsinfo.com/versions.shtml
To find the compiler version, look at the top of the .LST file
for your project. It will be a number such as 3.191, 3.216, etc. |
|
|
stoppsm
Joined: 19 Jan 2005 Posts: 2
|
|
Posted: Thu Jan 20, 2005 2:48 am |
|
|
The version is PCM 3.178 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jan 20, 2005 4:02 pm |
|
|
I tested it with PCM vs. 3.178, for a 16F877. It appears to just be a
bug in the .LST file output. The ASM code looks OK. You can see
below that it has the space (0x20) and the ? (0x3F) character, followed
by the string terminator (0x00).
Code: | 0004 100A 00009 BCF 0A.0
0005 108A 00010 BCF 0A.1
0006 110A 00011 BCF 0A.2
0007 0782 00012 ADDWF 02,F
0008 3472 00013 RETLW 72
0009 3465 00014 RETLW 65
000A 3461 00015 RETLW 61
000B 3464 00016 RETLW 64
000C 3479 00017 RETLW 79
000D 3420 00018 RETLW 20
000E 343F 00019 RETLW 3F
000F 3400 00020 RETLW 00 |
Here's the test program that I used:
Code: | #include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#include <lcd.c>
//============================
void main()
{
printf(lcd_putc, "ready ?");
while(1);
} |
With vs. 3.178, it gives double question-marks in the list file:
Code: | 0000 00633 .................... printf(lcd_putc, "ready ??); |
With vs. 3.216, it doesn't do that anymore, but it leaves off the closing double-quotation mark.
Code: | 0000 00650 .................... printf(lcd_putc, "ready ?); |
It's a recurring cosmetic bug and it should be fixed. You should report it to CCS tech support. |
|
|
|
|
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
|