汇编和C相互调用,keil环境,arm体系

C代码:

#include	   
extern void mystrcpy(char *s1,const char *s2);
int main(void)
{
	const char *string1="test example";
	char *string2="xxxxxxxxxxxx";
	mystrcpy(string2,string1);

	while(1)
	{
	;
	}


}

汇编代码:

				  
	EXPORT mystrcpy
	
	AREA strcpyasm,CODE,READONLY
	
	CODE32
	
mystrcpy
	ldr R15,=0x1
	str r2,[r0],#1
	cmp r2,#0
	bne mystrcpy
	BX LR
    	
	END



 

你可能感兴趣的:(S3C2440裸机代码,混合编程(c,+,asm,))