Why would CODE BLOCK #3 below fail to fill in all 8 bytes of the @??
I've even printed out all the values for 'a' in CODE BLOCK #3 without changing the 36869 and doing the assigning of the 0xFF and all 8 values print correctly until I do the assignining.
Am I doing something really stupid that I'm just not seeing or is there some CC65 quirk that I should be aware of??
Code: Select all
#include <stdio.h>
#define BYTE unsigned char
#define POKE(x,y) *(BYTE*)(x)=y
void main( void )
{
int c;
BYTE *p;
int a;
POKE( 36879, 8 );
// Put a white @ char at the top of the screen
printf( "\x8e\x13\x40\n" );
POKE( 36869, 254 );
/* CODE BLOCK #1.. This works..
POKE( 6144, 255 );
POKE( 6145, 255 );
POKE( 6146, 255 );
POKE( 6147, 255 );
POKE( 6148, 255 );
POKE( 6149, 255 );
POKE( 6150, 255 );
POKE( 6151, 255 );
*/
/* CODE BLOCK #2..
// This works too..
for( a = 6144; a < 6152; a ++ )
{
//POKE( a, 0xFF ); Also works
p = (BYTE*) a;
*p = 0xFF;
}
*/
/* CODE BLOCK #3.. DOES NOT WORK!!?? */
for( c = 0; c < 8; c ++ )
{
a = 6144 + c;
p = (BYTE*) a;
*p = 0xFF;
}
}