IPB

Welcome Guest ( Log In | Register )

> Compiling Assembly Code
twentysixdb
post Sep 12 2009, 09:29 PM
Post #1


Newbrie


Group: Members
Posts: 2
Joined: 12-September 09
Member No.: 5,278



Hi All:
I am writing a simple assembly time delay routine and the only line that will NOT compile is the conditional. If have tried every permutation to try and get it to go, but no luck...compiler output follows code snipet.

void ms_delay( void )
{
asm
{
movlw 0xE6 ; 230 decimal
_dly1:
nop
nop
nop
nop
nop
nop
nop
nop
nop
addlw 0xFF
BTFSS STATUS,Z
goto _dly1
return
}
}

The compiler output is:

Building...
BoostC Optimizing C Compiler Version 6.96 (for PIC16 architecture)
failure
C:\PIC Projects\16F690\BoostC\Phone\Time Delay\Time Delay.c(202): error: error in built-in assembly
C:\PIC Projects\16F690\BoostC\Phone\Time Delay\Time Delay.c(203): error: jump to undefined label
"C:\Program Files\SourceBoost\boostc_pic16.exe" "Time Delay.c" -t PIC16F690
Exit code was 1.
Removing target: Time Delay.obj
Done

When I comment the conditional line it compiles! Any thoughts?
Thanks,
Craig
update SourceBoost release 6.97 is available.
Download Now
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Martin Charlwood
post Oct 10 2009, 01:53 PM
Post #2


Newbrie


Group: Members
Posts: 1
Joined: 10-October 09
Member No.: 5,308



Try using btfss _status,Z
status is a variable memory mapped to a register to access variables from the assembler you have to proceed the variable name with an underscore.

Best Regards.
Martin

QUOTE (twentysixdb @ Sep 12 2009, 10:29 PM) *
Hi All:
I am writing a simple assembly time delay routine and the only line that will NOT compile is the conditional. If have tried every permutation to try and get it to go, but no luck...compiler output follows code snipet.

void ms_delay( void )
{
asm
{
movlw 0xE6 ; 230 decimal
_dly1:
nop
nop
nop
nop
nop
nop
nop
nop
nop
addlw 0xFF
BTFSS STATUS,Z
goto _dly1
return
}
}

The compiler output is:

Building...
BoostC Optimizing C Compiler Version 6.96 (for PIC16 architecture)
failure
C:\PIC Projects\16F690\BoostC\Phone\Time Delay\Time Delay.c(202): error: error in built-in assembly
C:\PIC Projects\16F690\BoostC\Phone\Time Delay\Time Delay.c(203): error: jump to undefined label
"C:\Program Files\SourceBoost\boostc_pic16.exe" "Time Delay.c" -t PIC16F690
Exit code was 1.
Removing target: Time Delay.obj
Done

When I comment the conditional line it compiles! Any thoughts?
Thanks,
Craig

Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 3rd September 2010 - 03:01 PM