thumb.c

来自「英培特嵌入式开发系统IDE软件包」· C语言 代码 · 共 62 行

C
62
字号
/*********************************************************************************************
* File:	thumb.c
* Author:	G.F.XU
* Desc:	c program of Thumb instruction
* History:	
*********************************************************************************************/

/*------------------------------------------------------------------------------------------*/
/*	 								global variables					 				    */
/*------------------------------------------------------------------------------------------*/
char szArm[22];
char szThumb[22];
unsigned long ulTemp = 0;

/*------------------------------------------------------------------------------------------*/
/*	 								extern function 					 			 	    */
/*------------------------------------------------------------------------------------------*/
extern void arm_function(void);

/*********************************************************************************************
* name:		delayt
* func:		delay functin with Thumb instruction
* para:		nTime --- input			
* ret:		none
* modify:
* comment:		
*********************************************************************************************/
static void delayt(int nTime)
{
	int i, j, k;
	
	k = 0;
	for(i = 0; i < nTime; i++)
	{
		for(j = 0; j < 10; j++)
			k++;
	}
}

/*********************************************************************************************
* name:		thumb_function
* func:		The following  example use Thumb instruction
* para:		none		
* ret:		none
* modify:
* comment:		
********************************************************************************************/
int thumb_function(void)
{
	int i;
	char * p = "Hello from Thumb World";
	
	ulTemp ++;
	arm_function();
    
    delayt(2);
	
	for(i = 0; i < 22; i++)
		szThumb[i] = (*p++);

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?