Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top