This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem while using assembly instruction (__asm intrinsic)



Hi,

I am trying to use __asm intrinsic to make jump to a location, but if i use this instruction in my code, the .out file doesn't get generated and i get the following error.

"MSP430: GEL: Encountered a problem loading file: C:\Users\Acer laptop\workspace_v6_1\FOTA_30July2015\Debug\FOTA_30July2015.out Could not open file"

What might be going wrong?

Thanks

Arun

  • It looks like the program failed to compile, so the debugger is unable to open the .out file. Try rebuilding the code and post any error messages from the compiler output.

    EDIT: Did you remember to leave a whitespace at the start of the assembly string? If this is missing then the opcode is treated as a label, which causes errors. If that isn't the problem, then post the whole __asm(" ")  line.

  • Why are you using that route (inline assembly) to jump to a location? You can do that in C:

    // Place the typedef and #define at the top of the file
    // where you need the jump, or include them in a header file
    
    typedef void (*tVoidFuncP)(void);
    #define JUMP_TO_LOCATION(x) ((tVoidFuncP)(x))
    
    // Then in your code where you need to execute the hard jump:
    JUMP_TO_LOCATION(0xC000); // jump to 0xC000
    
    
    
    

    This is portable method of doing a branch and is better than inline assembly.

  • Hi,

    1. I solved it by using call and also mov instructions, i observed that if the asm statement under quotes is not correct it throws load program error.

    2. I tried the C approach suggested by Brian , i got this warning "Statement not effective" at JUMP_TO_LOCATION(0xc000); and while executing it doesn't jump to the address.

    Any idea about this warning?

    Regards

    Arun

**Attention** This is a public forum