Jump to content
Guest Leon

Call Function In Assembly Bug ?

Recommended Posts

Guest Leon

Below is a suggested bug report format:

 

Bug description:

CALL function in ASM does not seem to work

 

Steps to reproduce:

 

CODE:

 

#include <system.h>

 

void main()

{

asm

{

CLRW

 

MOVWF _portc

MOVWF _trisc

 

 

CALL ROUTINE

MOVLW 0xFF

MOVWF _portc

 

GOTO LABELEND

 

ROUTINE :

 

MOVLW 0x03

MOVWF _portc

RETURN

 

LABELEND :

 

}

}

 

 

Expected behaviour:

How a fixed program should behave it should not give an error.

 

 

Is the problem 100% reproduceable:

this problem happens every time

 

IDE version: SourceBoost IDE 6.95

Compiler: Compiler BoostC

Compiler version: 6.95

Target device: PIC16F877A

OS: Windows XP Profesional SP3 Dutch

 

Comments:

If you replace the "CALL" with "GOTO" compiling is not a problem, of course the GOTO is not the same as the call.

replacing is just to check spelling and to check if the software works.

 

 

Regards,

Leon

Edited by Leon

Share this post


Link to post
Share on other sites

Hi Leon,

 

You may have to put your ROUTINE into a separate function like this:

 

void MyFunc(void) {
 asm
 {
MOVLW 0x03 
MOVWF _portc
RETURN
 }
}

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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...

×
×
  • Create New...