[cc65] hex encoded string bug?

From: Stefan Wessels <swessels1email.com>
Date: 2010-11-25 11:32:21
Hi,

I think there may be a bug in the way cc65 deals with hex encoded strings.  The following program has output as shown when run on the C64 and OS X.  I can't see any reason for the first character coming out as 0x48 and the 5th as 0xc0. 

Am I missing something or is this a bug?

I compiled with a trunk build from November 16th: cl65 luncompress.c -o luncompress.prg

--------- program --------- 
#include <stdio.h>

unsigned char *levelBuffer[1] =
{
"\x68\x03\x84\x00\x60\x82\x00\x06\x86",
};


int main()
{
	char i;
	
	for(i = 0; i < 9 ; i++)
		printf("%02x ", levelBuffer[0][i]);

	return 0 ;
}

--------- C64 output --------- 

    **** commodore 64 basic v2 ****

 64k ram system  38911 basic bytes free

ready.
load"luncompress.prg",8

searching for luncompress.prg
loading
ready.
run
48 03 84 00 c0 82 00 06 86
ready.

--------- OS X output --------- 

stefan-wesselss-mac-pro:Tools swessels$ gcc luncompress.c -o luncompress
stefan-wesselss-mac-pro:Tools swessels$ ./luncompress 
68 03 84 00 60 82 00 06 86 
stefan-wesselss-mac-pro:Tools swessels$ 

--------- END --------- 

Thank you
Stefan

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Nov 25 11:32:30 2010

This archive was generated by hypermail 2.1.8 : 2010-11-25 11:32:33 CET