convert function from CCS to HI-Tech

Status
Not open for further replies.

medo73

Newbie level 4
Joined
Apr 29, 2009
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,322
Hi I'm trying to convert this function from CCS:
Code:
byte crclo, crchi;
void crcBit(byte tbyte) {
#asm
	BCF		03,0
	RRF		crchi,F    //rotates the entire 16 bits to the right
	RRF		crclo,F
#endasm
	if (((STATUS & 0x01)^(tbyte)) == 0x01) {
		crchi = crchi^0x84;
		crclo = crclo^0x08;
	}
}

to Hi-tech where looks like
Code:
unsigned char crclo, crchi;

void crcbit(unsigned char tbyte) {

asm("BCF 03,0");
asm("RRF crchi,F");    //rotates the entire 16 bits to the right
asm("RRF crclo,F");
//#endasm
	if (((STATUS & 0x01)^(tbyte)) == 0x01) {
		crchi = crchi^0x84;
		crclo = crclo^0x08;
	}
}

but I got errors
rror [800] C:\DOCUME~1\...LOCALS~1\Temp\s5qg.; 471. undefined symbol "crchi"
Error [800] C:\DOCUME~1\OCALS~1\Temp\s5qg.; 474. undefined symbol "crclo"

What goes wrong?

thanks
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…