[Icc-430] ICC430 generating an invalid assembler
instruction
Richard
richard-lists at imagecraft.com
Wed May 9 12:24:29 PDT 2007
OH, if you are looking for a a workaround, something like this ought to work:
while (**s)
{
....
*s++;
}
Thanks.
At 09:33 AM 5/9/2007, you wrote:
>Hi Richard & All,
>
>I got the following error when trying to compile a C program:
>
>!E killme.s(xxx): invalid dst operand mode
>
>the offender line is:
>
> mov R11, at R1
>
>that is on the asm code the compiler created itself.
>
>I removed all unnecessary code from the program just to clarify. The
>single killme.c source is:
>
>void update_ptr(char **s)
>{
>while (*((*s)++)); //too many parenthesis?! ;-)
>}
>
>int proc_string(char* fullstring)
>{
> char c;
> while (c=*fullstring++) {
>
> switch (c) {
>
> case 0x81: //simple delay
> //bla bla bla
> update_ptr(&fullstring);
> //bla bla bla
> break;
>
> default:
> putchar(c);
> break;
> }
>
> }
> return 0;
>}
>
>void main(void)
>{
>proc_string("test""\x00""test2""\x00""test3");
>}
>
>
>
>I know I am not a genius C coder, but it seems the compiler should not
>generate an invalid assembler instruction even if my C program looks
>ugly...
>
>(obs: using ICC430 V7.05A, feb,14,2007), standard - dongle version
>
>Regards,
>Sergio.
>
>_______________________________________________
>Icc-430 mailing list
>Icc-430 at imagecraft.com
>http://dragonsgate.net/mailman/listinfo/icc-430
// richard (This email is for mailing lists. To reach me directly, please
use richard at imagecraft.com)
More information about the Icc-430
mailing list