Jump to content
twentysixdb

Compiling Assembly Code

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

 

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

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×