写一个简单的测试程序,c程序是这样的
#include "stdafx.h"
extern "C" DWORD infomation;
extern "C" int square(int a);
int hello(void)
{
int i;
for(i=0;i<10;i++)
{
printf("square of %d\n",i,square(i));
}
if(infomation!= 0)
return 0;
}
汇编是这样的
area |test|,DATA,READWRITE
GBLA infomation
infomation SETA 0
; EXTERN infomation
area |.text|,CODE,READONLY
EXPORT square
square
MUL r1, r0, r0 ;r1=r0*R0
MOV r0,r1 ;r0=r1
MOV pc,lr ;return r0
END
外部变量infomation在汇编中应该如何声明呢?