我有一个用于Windows Mobile6TI OMAP3430平台的Visual Studio2008Neon项目,我想使用ARM Cortex A8霓虹灯指令优化一些功能。Visual Studio2008包括微软ARM汇编程序v15.00.20720 (armasm.exe)
我在test.h中声明了一个函数
extern "C" unsigned __int32 Test();并在test.asm中实现为
ALIGN
Test FUNCTION
EXPORT Test
ldr r0, [r15] ; load the PC value in to r0
mov pc, lr ; return the value of r0
ENDFUNC我在pre-link事件中执行arm汇编程序,如下所示:
armasm.exe -32 -CPU ARM8 test.asm test.obj但是,我从工具中得到了这些错误
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使用Visual Studio ARM汇编程序的正确语法是什么?
发布于 2012-06-26 06:25:36
ARMASM非常易于使用,因为许多选项默认为合理的值。下面是你的代码的一个版本,它可以工作:
AREA my_test, CODE, READONLY ; name this block of code
EXPORT test
test proc ; start of a procedure
ldr r0,[r15]
mov pc,lr
endp ; end of a procedure
end ; end of the file更新:忘记包含'area‘
https://stackoverflow.com/questions/11193653
复制相似问题