Inine assembly in LPC Xpresso(cortex m3)

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

Inine assembly in LPC Xpresso(cortex m3)

316 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by venkateshkuppan on Tue Feb 12 05:57:30 MST 2013
I am trying to write a simple program combining C and assembly language.
I used the following syntax:

eg:

int main()
{

__asm
(
    "add r0,#1\n"
    "add r1,r0\n"
);
return 0;
}


but here while debugging the assembly part does not get executed, the control directly goes to the end of program.

So do I have to include some symbols or is there a mistake in the code I am using?
0 Kudos
3 Replies

284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by venkateshkuppan on Mon Feb 18 11:24:58 MST 2013
I am writing a code for context switching in LPC 1769.
I changed the mode to User/PSP by writing appropriately to the CONTROL register.Next I made use of SVC. But here I get a Hard Fault and error stating ----{No source available for "g_pfnVectors() at 0x0"}



I wrote a C program, switched to assembly for changing mode to User/PSP and here I use SVC.
Could you please tell how I can get back to Privileged/MSP and what exactly the error means.

Thankyou.
0 Kudos

284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by venkateshkuppan on Mon Feb 18 11:20:33 MST 2013
thanks
0 Kudos

284 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Feb 12 06:13:18 MST 2013
You need to set instruction stepping mode (the icon on the Debug view that looks like "i->"). The debugger normally steps C statements and your __asm block will look like a single C statement to the debugger. With instruction stepping mode on, you will step each individual assembler instruction.

Hope that helps,
0 Kudos