BRCLR AND BRSET OPCODE BUG PROBLEM ADDING ASM LINES INTO C CODING

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BRCLR AND BRSET OPCODE BUG PROBLEM ADDING ASM LINES INTO C CODING

2,875 Views
ganimides
Contributor I
Hi all !.
 
I`m trying to add ASM inlines into C coding using CODEWARRIOR 5.0 and just when I am going to compile it some errors that not even exist on Compiler error list appear and it`s driving me very crazyyy!!!..
 
Apparently this occurs when using a BRCLR AND BRSET opcodes.I was searching on the net for help and some documents explain that these kind of bugs were detected in CODEWARRIOR 4.0 al least.If I`m not mistaken these would happen because OCDEWARRIOR issues two ASM compilers separatelly and depends on what kind of statement you are using.
 
Please someone who can tell what am I doing wrong.
 
I here attached the code.
 
 
Thanks you very much.
 
 
 
Ganimides
Labels (1)
0 Kudos
4 Replies

649 Views
CrasyCat
Specialist III
Hello
Well just take a look at the preprocessor output for file main.c and you should figure out what is going on :smileywink:.
 
First in function lee_tarjeta remove the semi column after BRCLR
            BRCLR;  DATA_0,PORTA,DESC_PAR
            BRCLR;  DATA_1,PORTA,DESC_PAR                   
Then remove the semi column at the end of the defines:
#define DATA_0 0x03;
#define DATA_1 0x02;
#define PORTA  PTA;
Compiler should then understand the BRCLR.
 
CrasyCat
0 Kudos

649 Views
rocco
Senior Contributor II
Hi, Ganimides:

What is the error message?

In which file does the error occur?

In one of your files, I found the following two lines:
            BRCLR;   DATA_0,PORTA,DESC_PAR
            BRCLR;   DATA_1,PORTA,DESC_PAR                   
These will certainly cause some kind of error, as it involves opcodes with no operands. It appears the operands have been commented out, even though BRCLR requires three.
0 Kudos

649 Views
ganimides
Contributor I
Dear Rocco,thank you for responding.
 
I put this semi colons becasue of I get tired to test it with no succesfull.
The error ocurrs when the compiler watch over the BRCLR and BRSET opcodes and it remains looping on.this place.
 
Please I just need if you take a look the entire code and tell me what am I doing wrong.
 
 
Best regards
 
 
 
Ganimides
 
 
 
0 Kudos

649 Views
rocco
Senior Contributor II
Hi, Ganimides:

There is not much I can tell from just looking at the code.

What is the error message you receive?

At what lines do they occur?

Besides the operands being commented out, which would certainly cause errors, I noticed another syntax problem. In some lines, you have
        BRCLR   #DATA_0,PORTA,FC_D0_A
with a "#" before the bit number in the operand field, and in other lines you have
        BRCLR   DATA_0,PORTA,WAIT3
without a "#". I believe the correct syntax would not have a "#" in the operand field.
0 Kudos