gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: SDCC/PIC Newbie questions
From: Rick Mann
Date: Tue, 23 Sep 2003 23:51:24 -0700

Hi. I finally got SDCC running on my Mac, and wanted to try porting 
some PIC asm files I'd written to test it out. However, I'm not clear 
on how to write, in C, code to do the following:

	bsf		PCON,NOT_POR			;	Set POR so we remember
	bcf		STATUS,RP0				;	Select Bank 0

I would have thought something like:

{
	NOT_POR = 1;
	RP0 = 0;
}

But that does not seem to work as expected. The first line generates 
code like this:

	BSF	(_NOT_POR >> 3), (_NOT_POR & 7)

Which doesn't seem to me like the correct code. I tried something like

{
	PCON |= 1 << NOT_POR;
}

But that expanded into a great many lines of code.

Any ideas? Thanks!

-- 
Rick


gnupic@linuxhacker.org