Reply by ahma...@yahoo.com March 31, 20082008-03-31
Hi,
The "unrecognized token" error is only because of text and you must rewrite or edit your text ( by using "delete" and "backspace" keys on keyboard).
Ahmad
>
>Below program I found in the CCS help. I tried to simulate it but got errors. Why ?
>
>"Read data.c", line 4: error: unrecognized token
>"Read data.c", line 4: error: expected an expression
>"Read data.c", line 7: error: identifier "fid" is undefined
>"Read data.c", line 7: error: unrecognized token
>"Read data.c", line 7: error: expected an expression
>"Read data.c", line 8: error: unrecognized token
>"Read data.c", line 8: error: expected an expression
>7 errors detected in the compilation of "Read data.c".
>
>=========================================================================>The C I/O functions make it possible to access the host's operating system to perform I/O (using the debugger). For example, printf statements executed in a program appear in the debugger command window. When used in conjunction with the debugging tools, the capability to perform I/O on the host gives you more options when debugging and testing code.
>To use the I/O functions, include the header file stdio.h for each module that references a C I/O function.
>For example, given the following program in a file named main.c:
>
>#include
>main()
>{
> FILE *fid;
> fid = fopen("myfile","w");
> fprintf(fid,"Hello, world\n");
> fclose(fid);
> printf("Hello again, world\n");
>}
>Issuing the following shell command compiles, links, and creates the file main.out:
>cl500 main.c -z -heap 400 -l rts500.lib -o main.out
>Executing main.out under the debugger on a SPARC host accomplishes the following:
>
>1) Opens the file myfile in the directory where the debugger was invoked
>
>2) Prints the string Hello, world into that file
>
>3) Closes the file
>
>4) Prints the string Hello again, world in the debugger command window
>
>With properly written device drivers, the library also offers facilities to perform I/O on a user-specified device.
>If there is not enough space on the heap for a C I/O buffer, buffered operations on the file will fail. If a call to printf() mysteriously fails, this may be the reason. Check the size of the heap. To set the heap size, use the -heap option when linking.
>
>======================================================================>
>Regards,
>Dayah
>Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Reply by daya...@yahoo.com March 9, 20082008-03-09
Hi,

Below program I found in the CCS help. I tried to simulate it but got errors. Why ?

"Read data.c", line 4: error: unrecognized token
"Read data.c", line 4: error: expected an expression
"Read data.c", line 7: error: identifier "fid" is undefined
"Read data.c", line 7: error: unrecognized token
"Read data.c", line 7: error: expected an expression
"Read data.c", line 8: error: unrecognized token
"Read data.c", line 8: error: expected an expression
7 errors detected in the compilation of "Read data.c".

=========================================================================The C I/O functions make it possible to access the host's operating system to perform I/O (using the debugger). For example, printf statements executed in a program appear in the debugger command window. When used in conjunction with the debugging tools, the capability to perform I/O on the host gives you more options when debugging and testing code.
To use the I/O functions, include the header file stdio.h for each module that references a C I/O function.
For example, given the following program in a file named main.c:

#include
main()
{
FILE *fid;
fid = fopen("myfile","w");
fprintf(fid,"Hello, world\n");
fclose(fid);
printf("Hello again, world\n");
}
Issuing the following shell command compiles, links, and creates the file main.out:
cl500 main.c -z -heap 400 -l rts500.lib -o main.out
Executing main.out under the debugger on a SPARC host accomplishes the following:

1) Opens the file myfile in the directory where the debugger was invoked

2) Prints the string Hello, world into that file

3) Closes the file

4) Prints the string Hello again, world in the debugger command window

With properly written device drivers, the library also offers facilities to perform I/O on a user-specified device.
If there is not enough space on the heap for a C I/O buffer, buffered operations on the file will fail. If a call to printf() mysteriously fails, this may be the reason. Check the size of the heap. To set the heap size, use the -heap option when linking.

======================================================================
Regards,
Dayah
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467