#9121 - Domovoi - Mon Jul 28, 2003 6:30 pm
I have a GBA program that compiles just fine. When I insert the following piece of code:
...and compile, I get 5 errors:
---
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s: Assembler messages:
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:43: Error: byte or halfword not valid for base register
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:44: Error: byte or halfword not valid for base register
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:45: Error: byte or halfword not valid for base register
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:46: Error: byte or halfword not valid for base register
NMAKE : fatal error U1077: 'gcc' : return code '0x1'
---
Then I change the for statement to this:
...and compile. No problems, compiles just fine.
Since when is it impossible for an int to be a value larger than 3?
It gets weirder. When I change it back to i < 5 and comment out the bg2.tiledata line (which, if you look closely, doesn't even -do- anything with the i variable), it suddenly compiles nicely.
Here's something similar:
This works fine:
But this, which is the same code, only twice, generates those five errors again:
And so does this:
for (int loop=0; loop < 256*32; ++loop)
{
bg1.tileData[loop] = 0;
}
for (int loop=0; loop < 256*32; ++loop)
{
bg2.tileData[loop] = 0;
}
[/code]
What's going on here? It's impossible for me to loop through my tile data this way. The compiler seems to just randomly decides when I can and can't use a for loop.
What is this, a plot against me? Is GCC just dodgy? What's going on?
Code: |
for (int i=0; i < 5; ++i) { bg2.tileData[32] = 10; } |
...and compile, I get 5 errors:
---
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s: Assembler messages:
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:43: Error: byte or halfword not valid for base register
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:44: Error: byte or halfword not valid for base register
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:45: Error: byte or halfword not valid for base register
/cygdrive/c/DOCUME~1/Standard/LOCALS~1/Temp/ccepU2IR.s:46: Error: byte or halfword not valid for base register
NMAKE : fatal error U1077: 'gcc' : return code '0x1'
---
Then I change the for statement to this:
Code: |
for (int i=0; i < 4; ++i) |
...and compile. No problems, compiles just fine.
Since when is it impossible for an int to be a value larger than 3?
It gets weirder. When I change it back to i < 5 and comment out the bg2.tiledata line (which, if you look closely, doesn't even -do- anything with the i variable), it suddenly compiles nicely.
Here's something similar:
This works fine:
Code: |
for (int loop=0; loop < 256*32; ++loop) { bg1.tileData[loop] = 0; } |
But this, which is the same code, only twice, generates those five errors again:
Code: |
for (int loop=0; loop < 256*32; ++loop) { bg1.tileData[loop] = 0; } for (int loop=0; loop < 256*32; ++loop) { bg1.tileData[loop] = 0; } |
And so does this:
for (int loop=0; loop < 256*32; ++loop)
{
bg1.tileData[loop] = 0;
}
for (int loop=0; loop < 256*32; ++loop)
{
bg2.tileData[loop] = 0;
}
[/code]
What's going on here? It's impossible for me to loop through my tile data this way. The compiler seems to just randomly decides when I can and can't use a for loop.
What is this, a plot against me? Is GCC just dodgy? What's going on?