Page 1 of 1

Compile Error W/BTFSS

Posted: Wed Jun 13, 2012 4:20 pm
by jbell
Hi Folks,

I'm really new to assembly programming, so please bear with me if my problems seem trivial.

I'm trying to "Compile To Hex" the attached snippet of code to make a simple timing loop, but it's choking on the BTFSS line. I've come to this conclusion because if I REM the BTFSS line out, it will compile sucessfully.

Any assistance greatly appreciated.

Jim Bell

Re: Compile Error W/BTFSS

Posted: Wed Jun 13, 2012 9:49 pm
by medelec35
Hi Jim,
Registers should be in lower case and preceded with an underscore. its the bit names that are in uppercase.
Try:

Code: Select all

asm
{
WaitLop: movlw    0xFA      //Delay Time
         nop
loopBas: addlw    0xFF      //dec W
         btfss    _status,Z  //Zero flag set?
         bra      loopBas   //  No, keep looping
         nop                //  Yes, done
}
Martin

Re: Compile Error W/BTFSS

Posted: Wed Jun 13, 2012 11:20 pm
by jbell
Martin,

That's got it!

Thanks a lot for your help....

Jim Bell

Re: Compile Error W/BTFSS

Posted: Thu Jun 14, 2012 7:47 am
by medelec35
Your welcome,
Glad it worked for you.
Thanks for the update.

Martin