When compiling a C program I got a Syntax Error at the Assembling step.
It complains about a macro in the generated .s file.
The fact is that in MACRO.H, I do not see this macro anywhere.
Do you have an Idea how we could correct this bad bug ?
thank you
osdk Syntax error in C compilation : MULI_CCD(3,-1,tmp0)
Re: osdk Syntax error in C compilation : MULI_CCD(3,-1,tmp0
There are several missing macros. Maybe there is something in the documentation of the compiler, at least about what the macro should do, so we could write it. But I think Dbug should help here...waskol wrote:When compiling a C program I got a Syntax Error at the Assembling step.
It complains about a macro in the generated .s file.
The fact is that in MACRO.H, I do not see this macro anywhere.
Do you have an Idea how we could correct this bad bug ?
thank you
Also you could try to figure out which instruction generated the macro and re-write it in another way
herrrrrrrrrrrr........
Chema, you ar funny !
I think you over-estimate me
The thing is that I search a bit everywhere (osdk svn, google) and found nothing :stuck !
I am pretty sure that this MULTI__CCD macro comes from the cpp.exe excutable but i did not find the source code anywhere.
More over I am not sure at all that one day in my all life I should be able to write this macro myself in MACROS.H : I am not clever enough for that !
Chema, you ar funny !
I think you over-estimate me
The thing is that I search a bit everywhere (osdk svn, google) and found nothing :stuck !
I am pretty sure that this MULTI__CCD macro comes from the cpp.exe excutable but i did not find the source code anywhere.
More over I am not sure at all that one day in my all life I should be able to write this macro myself in MACROS.H : I am not clever enough for that !
I was never able to write any of these macros myself toowaskol wrote:herrrrrrrrrrrr........
Chema, you ar funny !
I think you over-estimate me
But it is not in the sources of the compiler where we should look at. I know there must be some kind of documentation where each macro is explained (never saw it, but must exist). Then it is a matter of implementing it in 6502 asm (they are not too difficult, really) and adding it to the macros.h file.
Anyway, when talking about C code, I meant you (maybe) can figure out which of your instructions generated the offending macro, and try to doit differently.
Imagine you have something like
Code: Select all
k=3*(-1);
Anyway, you can comment the code and see if the error still exists. If it does not, then you can try to change your code to something like:
Code: Select all
t=-1; k=3*t;
It is a quick hack. I had to do something similar once to avoid a missing macro, but I cannot remember the exact case.
If you cannot relate the macro to your code at any point, you can try by simply commenting parts until you find it.
Not the nicest thing to do, but I see no other chance...
I reproduced it, here it is :
of course, things are gone when you correct like this :
Code: Select all
//
// This is a simple compilation error test
//
#include <lib.h>
#define MY_CONSTANT 10
void main()
{
int n;
n=MY_CONSTANT *-1;
printf("%d",n);
}
Code: Select all
n=-MY_CONSTANT;
I dig up this thing a little bit, here are my results :
Conclusion : this happens only when
the 1st member is a constant AND when 2nd member is a negative constant
Code: Select all
//
// This is a simple compile error test sample
//
#include <lib.h>
#define C1 10
#define C2 -3
#define C3 6
void main()
{
int n;
char m;
m=-5;
n=C1*C2; //MULI_CCD syntax error (2nd member is a negative constant
// AND 1st member is a constant)
printf("%d",n);
n=C1*C3; //no error (2nd member is a positive)
printf("%d",n);
n=C2*m; //no error (2nd member is a variable)
printf("%d",n);
n=m*C2; //no error (1st member is a variable)
printf("%d",n);
n=C2*C1; //no error (2nd member is a positive)
printf("%d",n);
}
the 1st member is a constant AND when 2nd member is a negative constant