How do I use the SC3900 "bmtsta" instruction with inline assembler

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

How do I use the SC3900 "bmtsta" instruction with inline assembler

1,815 Views
PaulNewton
Contributor I

I am using CodeWarriror v10.9.0 writing code for a B4860 with the SC3900 core.

I would like to use an inline assembler statement in my C to test a mask on the status register: "bmtsta.c #$10BC,SR.L,P0"

To ensure I have used valid instructions, I have copied some examples from the "SC3900FP Flexible Vector Processor (FVP) Core Reference Manual" which use the "bmtsta" instruction, but none of them are accepted when I compile my code.

 

For example, within a C function, I have tried:

    bmtsta.s #5,sr,p1

    BMTSTA.S #$2000,SR.L,P2

as:

    asm(" bmtsta.s #5,sr,p1": );

    asm(" BMTSTA.S #$2000,SR.L,P2": );

both give a parse error:

    [LLT,2,4001,16]: Parse error - . 1                     bmtsta.s #5,sr,p1;                  (95; 0)

    [LLT,2,4001,17]: Parse error - . 1                     BMTSTA.S #$2000,SR.L,P2;            (97; 0)

 

None of the manuals I have searched refer to "parse error", so I am unsure if the numbers in the square braces are useful to me in understanding the problem.

 

Whilst trying to understand the syntax of the C asm() instruction, I also noticed that the nop instruction is not accepted.

 

For example, nop.dalu and nop.agu are accepted, but nop results in a parse error.

    asm(" nop.dalu": );

    asm(" nop.agu": );

are OK, but:

    asm(" nop": );

gives:

    [LLT,2,4001,20]: Parse error - . 1                     nop;                         (101; 0)

 

Can anyone help me understand how to call the bmtsta instruction from C?

Why does the nop instruction not work?

Which manual tells me how to read the parse error message code "[LLT,2,4001,20]"?

 

Paul

Labels (1)
Tags (1)
0 Kudos
1 Reply

1,316 Views
lunminliang
NXP Employee
NXP Employee

Hello Paul,

Bmtsta instructions are not supported in inline assembly because they use explicit predicate bits.

And this interfaces with the predicate allocation.

The recommendation is to use inline assembly functions.

Have a great day,
Lunmin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos