I have a Visual Studio 2008 C++03 project for a Windows Mobile 6 TI OMAP 3430 platform where I would like to optimize some functions using ARM Cortex A8 NEON instructions.
Visual Studio 2008 includes Microsoft ARM Assembler v15.00.20720 (armasm.exe)
I have declared a function in test.h
extern "C" unsigned __int32 Test();
and implemented it in test.asm as
ALIGN
Test FUNCTION
EXPORT Test
ldr r0, [r15] ; load the PC value in to r0
mov pc, lr ; return the value of r0
ENDFUNC
I execute the arm assembler in the pre-link event as:
armasm.exe -32 -CPU ARM8 test.asm test.obj
But, I get these errors back from the tool
test.asm(4) : error A0064: code inside data section
1> ldr r0, [r14] ; load the PC value in to r0
test.asm(5) : error A0064: code inside data section
1> mov pc, lr ; return the value of r0
test.asm(7) warning : A0063: missing END directive
1>ENDFUNC
What is the correct syntax for using the Visual Studio ARM assembler?
ARMASM is very simple to use because many of the options default to reasonable values. Here’s a version of your code that will work:
Update: forgot to include ‘area’