Jump to content

Search the Community

Showing results for tags 'inline assembly'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 2 results

  1. I am writing a simple task scheduler for my MSP430F5529 USB launchpad. I need to update stack pointer(SP), then enable interrupts and then update program counter (PC). But I am getting an error with my inline asmebly code. void start_scheduler(void) { asm volatile("mov.w task1stack, SP \n" "EINT \n" "mov.w func1, PC \n" ); } - task1stack is the stack area for the task execution. It is an array. - func1 is a function - instead of uppercase for 'SP' and 'PC', I tried lowercase also. But the error was present. But with the above code, compiler is showing the below error kernel.c:(.text+0x8e): undefined reference to `SP' kernel.c:(.text+0x96): undefined reference to `PC' Questions: 1. How to update SP and PC ? 2. Can "mov.w task1stack, SP \n" copy array address to SP ? Is my syntax correct ? 3. Can "mov.w func1, PC \n" copy the func1 address to PC? Is my syntax correct ?
  2. Good morning. I am trying to work on a small project for the Stellaris LM4F120 board, and as part of the project, I have a need to read the stack variable. (I'm constructing a small context switcher for demonstration purposes.) I obtained a segment of code from the web as follows: static inline void * rd_stack_ptr(void){ void * result=NULL; asm volatile ("MRS %0, msp\n\t" "MOV r0, %0 \n\t" : "=r" (result) ); return result; } Essentially, what the code is supposed to do is copy the stack pointer into the c variable "result" and return it. However, I am getting errors as follows: Description Resource Path Location Type #126 expected a "(" os.c /OperatingSystem line 27 C/C++ Problem #18 expected a ")" os.c /OperatingSystem line 29 C/C++ Problem I have been unable to really find examples of this syntax in the CCS help files, though the code is supposedly written for CCS. I am using TI compiler v4.9.5 if that provides any assistance. Thanks for any info you have. I've done this many times before on other processors, I just haven't been able to find the right manual page with the right details for this part from the materials I have access to. Walt Schilling Note: I've also cross posted this to another TI forum as well.
  • Create New...