ADS1.2 trouble: branching by writing PC is not supported

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello, I got into trouble when learning ADS 1.2 inline assembly.

I create a project as arm executable image in default settings.
It contains only one file : main.c

void main(void){

    __asm
    {    
        mov pc,0x0
    }
    
    
}


When i compiled this project , i got the error :

Warning : C2865W: extern 'main' needs to be 'int' function: 'int' assumed
main.c line 1
Error   : (Serious) C2044E: branching by writing PC is not supported
main.c line 6
C:\main.c: 1 warning, 0 errors, 1 serious error


I google  and find this file
" www.arm.com/support/ADS_Errors_and_Warnings.pdf "
it says
"C2044E: branching by writing PC is not supported. Illegal inline
assembly instruction – consult the ARM ARM for the allowed forms. "

Then I have a looked at arm architecture reference manual ,
but nothing helps.

I think maybe ADS1.2  compiler  doesn't support this kinds of syntax.
But how can I achieve the  goal like this ?

Anybody help ,pls ? Thanks!

Re: ADS1.2 trouble: branching by writing PC is not supported

Quoted text here. Click to load it

apparently main is defined as: int main(...), just change it.


Quoted text here. Click to load it
[...]
Quoted text here. Click to load it

seems like you are not allowed to take a branch in your program by directly
writing to the pc, is jmp (or something equivalent) not an option?



Site Timeline