www.pudn.com > ucos port forf240.rar > main.asm, change:2003-11-18,size:10996b


******************************************************* 
* TMS320C2x/C2xx/C5x ANSI C Codegen Version 7.00        
******************************************************* 
;	C:\TIC2XX\C2000\CGTOOLS\BIN\DSPAC.EXE -v2xx test3.c C:\WINDOWS\TEMP\test3.if  
;	dspopt NOT RUN 
;	C:\TIC2XX\C2000\CGTOOLS\BIN\DSPCG.EXE -o -v2xx -o C:\WINDOWS\TEMP\test3.if C:\WINDOWS\TEMP\test3.asm C:\WINDOWS\TEMP\test3.tmp  
	.port 
	.bss	_led,1,1 
	.bss	_TestTaskStk,100 
	.bss	_TaskStk,100 
	.file	"test3.c" 
	.file	"os_cpu.h" 
	.sym	_BOOLEAN,0,14,13,16 
	.sym	_INT8U,0,14,13,16 
	.sym	_INT8S,0,4,13,16 
	.sym	_INT16U,0,14,13,16 
	.sym	_INT16S,0,4,13,16 
	.sym	_INT32U,0,15,13,32 
	.sym	_INT32S,0,5,13,32 
	.sym	_FP32,0,6,13,32 
	.sym	_FP64,0,7,13,32 
	.sym	_OS_STK,0,14,13,16 
	.sym	_OS_CPU_SR,0,14,13,16 
	.file	"os_cfg.h" 
	.sym	_OS_FLAGS,0,14,13,16 
	.file	"ucos_ii.h" 
 
	.stag	.fake0,96 
	.member	_OSEventType,0,14,8,16 
	.member	_OSEventGrp,16,14,8,16 
	.member	_OSEventCnt,32,14,8,16 
	.member	_OSEventPtr,48,16,8,16 
	.member	_OSEventTbl,64,62,8,32,,2 
	.eos 
	.sym	_OS_EVENT,0,8,13,96,.fake0 
 
	.stag	.fake1,64 
	.member	_OSCnt,0,14,8,16 
	.member	_OSEventTbl,16,62,8,32,,2 
	.member	_OSEventGrp,48,14,8,16 
	.eos 
	.sym	_OS_SEM_DATA,0,8,13,64,.fake1 
 
	.stag	_os_tcb,176 
	.member	_OSTCBStkPtr,0,30,8,16 
	.member	_OSTCBNext,16,24,8,16,_os_tcb 
	.member	_OSTCBPrev,32,24,8,16,_os_tcb 
	.member	_OSTCBEventPtr,48,24,8,16,.fake0 
	.member	_OSTCBDly,64,14,8,16 
	.member	_OSTCBStat,80,14,8,16 
	.member	_OSTCBPrio,96,14,8,16 
	.member	_OSTCBX,112,14,8,16 
	.member	_OSTCBY,128,14,8,16 
	.member	_OSTCBBitX,144,14,8,16 
	.member	_OSTCBBitY,160,14,8,16 
	.eos 
	.sym	_OS_TCB,0,8,13,176,_os_tcb 
	.globl	_OSCtxSwCtr 
	.globl	_OSEventFreeList 
	.globl	_OSEventTbl 
	.globl	_OSIntNesting 
	.globl	_OSIntExitY 
	.globl	_OSLockNesting 
	.globl	_OSPrioCur 
	.globl	_OSPrioHighRdy 
	.globl	_OSRdyGrp 
	.globl	_OSRdyTbl 
	.globl	_OSRunning 
	.globl	_OSTaskCtr 
	.globl	_OSIdleCtr 
	.globl	_OSTaskIdleStk 
	.globl	_OSTCBCur 
	.globl	_OSTCBFreeList 
	.globl	_OSTCBHighRdy 
	.globl	_OSTCBList 
	.globl	_OSTCBPrioTbl 
	.globl	_OSTCBTbl 
	.globl	_OSTime 
	.globl	_OSMapTbl 
	.globl	_OSUnMapTbl 
	.globl	_OSSemCreate 
	.globl	_OSSemPend 
	.globl	_OSSemPost 
	.globl	_OSTaskCreate 
	.globl	_OSTimeDly 
	.globl	_OSTimeDlyHMSM 
	.globl	_OSTimeGet 
	.globl	_OSTimeSet 
	.globl	_OSTimeTick 
	.globl	_OSInit 
	.globl	_OSIntEnter 
	.globl	_OSIntExit 
	.globl	_OSStart 
	.globl	_OSStatInit 
	.globl	_OSVersion 
	.globl	_OS_EventTaskRdy 
	.globl	_OS_EventTaskWait 
	.globl	_OS_EventTO 
	.globl	_OS_EventWaitListInit 
	.globl	_OS_Sched 
	.globl	_OS_TaskIdle 
	.globl	_OS_TCBInit 
	.globl	_OSInitHookBegin 
	.globl	_OSInitHookEnd 
	.globl	_OSIntCtxSw 
	.globl	_OSStartHighRdy 
	.globl	_OSTaskCreateHook 
	.globl	_OSTaskDelHook 
	.globl	_OSTaskIdleHook 
	.globl	_OSTaskStatHook 
	.globl	_OSTaskStkInit 
	.globl	_OSTaskSwHook 
	.globl	_OSTCBInitHook 
	.globl	_OSTimeTickHook 
	.globl	_OSCtxSw 
	.globl	_OSTickISR 
	.file	"register.h" 
	.globl	_portFFFF 
	.file	"C:\tic2xx\c2000\cgtools\include\stdio.h" 
	.sym	_size_t,0,14,13,16 
 
	.stag	.fake2,112 
	.member	_fd,0,4,8,16 
	.member	_buf,16,28,8,16 
	.member	_pos,32,28,8,16 
	.member	_bufend,48,28,8,16 
	.member	_buff_stop,64,28,8,16 
	.member	_flags,80,14,8,16 
	.member	_index,96,4,8,16 
	.eos 
	.sym	_FILE,0,8,13,112,.fake2 
	.sym	_fpos_t,0,5,13,32 
 
	.stag	.fake3,272 
	.member	_name,0,50,8,144,,9 
	.member	_flags,144,13,8,16 
	.member	_OPEN,160,148,8,16 
	.member	_CLOSE,176,148,8,16 
	.member	_READ,192,148,8,16 
	.member	_WRITE,208,148,8,16 
	.member	_LSEEK,224,149,8,16 
	.member	_UNLINK,240,148,8,16 
	.member	_RENAME,256,148,8,16 
	.eos 
	.sym	__DEVICE,0,8,13,272,.fake3 
	.globl	__ftable 
	.globl	__tmpnams 
	.globl	_remove 
	.globl	_rename 
	.globl	_tmpfile 
	.globl	_tmpnam 
	.globl	_fclose 
	.globl	_fopen 
	.globl	_freopen 
	.globl	_setbuf 
	.globl	_setvbuf 
	.globl	_fflush 
	.globl	_fprintf 
	.globl	_fscanf 
	.globl	_printf 
	.globl	_scanf 
	.globl	_sprintf 
	.globl	_sscanf 
	.globl	_vfprintf 
	.globl	_vprintf 
	.globl	_vsprintf 
	.globl	_fgetc 
	.globl	_fgets 
	.globl	_fputc 
	.globl	_fputs 
	.globl	_getc 
	.globl	_getchar 
	.globl	_gets 
	.globl	_putc 
	.globl	_putchar 
	.globl	_puts 
	.globl	_ungetc 
	.globl	_fread 
	.globl	_fwrite 
	.globl	_fgetpos 
	.globl	_fseek 
	.globl	_fsetpos 
	.globl	_ftell 
	.globl	_rewind 
	.globl	_clearerr 
	.globl	_feof 
	.globl	_ferror 
	.globl	_perror 
	.globl	_getenv 
	.globl	_add_device 
	.file	"test3.c" 
	.globl	_TestTaskStk 
	.globl	_TaskStk 
	.globl	_TestTask 
	.globl	_Task 
	.text 
 
	.sym	_KickDog,_KickDog,32,2,0 
	.globl	_KickDog 
 
	.func	14 
;>>>> 	void KickDog(void) 
****************************************************** 
* FUNCTION DEF : _KickDog 
****************************************************** 
_KickDog: 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+,AR3 
 
	.line	3 
;>>>> 	     *WDKEY=0X0055; 
	LARK	AR3,28709 
	LACK	85 
	SACL	*  
	.line	4 
;>>>> 	     *WDKEY=0X00AA; 
	LACK	170 
	SACL	*  
	.line	5 
;>>>> 	     *WDCR=0X006F; 
	LACK	111 
	ADRK	4 
	SACL	*  
	.line	6 
;>>>> 	     return; 
EPI0_1: 
	.line	7 
	MAR	* ,AR1 
	SBRK	2 
	LAR	AR0,*- 
	PSHD	* 
	RET 
 
	.endfunc	20,000000000H,1 
 
	.sym	_HardwareInit,_HardwareInit,32,2,0 
	.globl	_HardwareInit 
 
	.func	22 
;>>>> 	void HardwareInit(void) 
****************************************************** 
* FUNCTION DEF : _HardwareInit 
****************************************************** 
_HardwareInit: 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+ 
 
	.line	3 
;>>>> 	    asm(" clrc CNF"); 
 clrc CNF 
	.line	4 
;>>>> 	    asm(" setc SXM"); 
 setc SXM 
	.line	5 
;>>>> 	    *IFR=0X0FFFF; 
	LARK	AR3,6 
	MAR	* ,AR3 
	SPLK	#65535,*  
	.line	6 
;>>>> 	    *IMR=0X0004;     /*enable Int2*/ 
	LACK	4 
	SBRK	2 
	SACL	*  
	.line	8 
;>>>> 	    *CKCR1=0X00BB;   /*clock in is 10MHz,cpu clock is 20Mhz*/ 
	LARK	AR4,28717 
	ADRK	183 
	MAR	* ,AR4 
	SAR	AR3,* ,AR3 
	.line	9 
;>>>> 	    *CKCR0=0X00C1; 
	ADRK	6 
	MAR	* ,AR4 
	SBRK	2 
	SAR	AR3,*  
	.line	10 
;>>>> 	    *SYSCR=0X40C0;  
	SBRK	19 
	SPLK	#16576,* ,AR3 
	.line	11 
;>>>> 	    *WDCR=0X006F; 
	SBRK	82 
	MAR	* ,AR4 
	ADRK	17 
	SAR	AR3,* ,AR1 
	.line	12 
;>>>> 	    KickDog(); 
	CALL	_KickDog 
	.line	13 
;>>>> 	    return; 
EPI0_2: 
	.line	14 
	SBRK	2 
	LAR	AR0,*- 
	PSHD	* 
	RET 
 
	.endfunc	35,000000000H,1 
 
	.sym	_T2PInit,_T2PInit,32,2,0 
	.globl	_T2PInit 
 
	.func	38 
;>>>> 	void T2PInit(void) 
****************************************************** 
* FUNCTION DEF : _T2PInit 
****************************************************** 
_T2PInit: 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+,AR3 
 
	.line	3 
;>>>> 	  *T2CNT=0X0000; 
	LARK	AR3,29701 
	LACK	0 
	SACL	*  
	.line	4 
;>>>> 	  *T2PR=0X186A;     /*timer interrupt frequence is 100HZ*/ 
	ADRK	2 
	SPLK	#6250,*+ 
	.line	5 
;>>>> 	  *T2CON=0X0EC0A;   /*continuous up/down mode,TPS is 16 */ 
	SPLK	#60426,*  
	.line	7 
;>>>> 	  *EVIFRB|=0X0001; 
	ADRK	40 
	LACK	1 
	OR	*  
	SACL	*  
	.line	8 
;>>>> 	  *EVIMRB=0X0001;    /*enable timer1 Period interrupt*/ 
	LACK	1 
	SBRK	3 
	SACL	*  
	.line	9 
;>>>> 	  return; 
EPI0_3: 
	.line	10 
	MAR	* ,AR1 
	SBRK	2 
	LAR	AR0,*- 
	PSHD	* 
	RET 
 
	.endfunc	47,000000000H,1 
 
	.sym	_nothing,_nothing,32,2,0 
	.globl	_nothing 
 
	.func	48 
;>>>> 	void  nothing(void) 
****************************************************** 
* FUNCTION DEF : _nothing 
****************************************************** 
_nothing: 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+ 
 
	.line	3 
;>>>> 	  return; 
EPI0_4: 
	.line	4 
	SBRK	2 
	LAR	AR0,*- 
	PSHD	* 
	RET 
 
	.endfunc	51,000000000H,1 
 
	.sym	_main,_main,32,2,0 
	.globl	_main 
 
	.func	54 
;>>>> 	void main(void) 
****************************************************** 
* FUNCTION DEF : _main 
****************************************************** 
_main: 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+ 
 
	.line	3 
;>>>> 	  HardwareInit(); 
	CALL	_HardwareInit 
	.line	4 
;>>>> 	  T2PInit(); 
	CALL	_T2PInit 
	.line	5 
;>>>> 	  OSInit();  
	CALL	_OSInit 
	.line	6 
;>>>> 	  printf("Inital End.\n"); 
	LRLK	AR3,SL0 
	SAR	AR3,*+ 
	CALL	_printf 
	MAR	*- 
	.line	7 
;>>>> 	  OSTaskCreate(TestTask,(void *)0,&TestTaskStk[0],4); 
	LACK	4 
	SACL	*+ 
	LALK	_TestTaskStk+0 
	SACL	*+ 
	LACK	0 
	SACL	*+ 
	LALK	_TestTask+0 
	SACL	*+ 
	CALL	_OSTaskCreate 
	SBRK	4 
	.line	9 
;>>>> 	  printf("MultiTask Start...\n"); 
	LRLK	AR3,SL1 
	SAR	AR3,*+ 
	CALL	_printf 
	MAR	*- 
	.line	10 
;>>>> 	  OSStart(); 
	CALL	_OSStart 
EPI0_5: 
	.line	11 
	SBRK	2 
	LAR	AR0,*- 
	PSHD	* 
	RET 
 
	.endfunc	64,000000000H,1 
 
	.sect	".cinit" 
	.word	1,_led 
	.word	0 
 
	.sym	_led,_led,4,2,16 
	.globl	_led 
	.text 
 
	.sym	_TestTask,_TestTask,32,2,0 
	.globl	_TestTask 
 
	.func	66 
;>>>> 	void TestTask(void *pdata) 
****************************************************** 
* FUNCTION DEF : _TestTask 
****************************************************** 
_TestTask: 
 
LF6	.set	0 
 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+,AR3 
 
	.sym	_pdata,-3+LF6,16,9,16 
	.line	2 
	.line	4 
;>>>> 	  pdata=pdata; 
	.line	5 
;>>>> 	  *T2CON|=0x0040; 
	LARK	AR3,29704 
	LACK	64 
	OR	*  
	SACL	* ,AR1 
	.line	6 
;>>>> 	  OSTaskCreate(Task,(void *)0,&TaskStk[0],5); 
	LACK	5 
	SACL	*+ 
	LALK	_TaskStk+0 
	SACL	*+ 
	LACK	0 
	SACL	*+ 
	LALK	_Task+0 
	SACL	*+ 
	CALL	_OSTaskCreate 
	SBRK	4 
	.line	7 
;>>>> 	  asm(" clrc INTM");       /*Stack init cpu status reg disable interrupt*/        
;>>>> 	  while(1) 
 clrc INTM 
L1: 
	.line	10 
;>>>> 	      led++; 
	LDPK	_led 
	LAC	_led 
	ADDK	1 
	SACL	_led 
	.line	11 
;>>>> 	      printf("led=%d\n",led); 
	BLKD	_led+0,*+ 
	LRLK	AR3,SL2 
	SAR	AR3,*+ 
	CALL	_printf 
	SBRK	2 
	.line	12 
;>>>> 	      OSTimeDly(1); 
	LACK	1 
	SACL	*+ 
	CALL	_OSTimeDly 
	MAR	*- 
	.line	14 
	B	L1 
	.endfunc	80,000000000H,1 
 
	.sym	_Task,_Task,32,2,0 
	.globl	_Task 
 
	.func	81 
;>>>> 	void Task(void *pdata) 
****************************************************** 
* FUNCTION DEF : _Task 
****************************************************** 
_Task: 
 
LF7	.set	0 
 
	POPD	*+ 
	SAR	AR0,*+ 
	SAR	AR1,* 
	LARK	AR0,1 
	LAR	AR0,*0+ 
 
	.sym	_pdata,-3+LF7,16,9,16 
	.line	2 
	.line	3 
;>>>> 	   pdata=pdata; 
	.line	4 
;>>>> 	   asm("	clrc INTM"); 
;>>>> 	   while(1) 
	clrc INTM 
L3: 
	.line	7 
;>>>> 	     printf("This is Task!\n"); 
	LRLK	AR3,SL3 
	SAR	AR3,*+ 
	CALL	_printf 
	MAR	*- 
	.line	8 
;>>>> 	     OSTimeDly(2); 
	LACK	2 
	SACL	*+ 
	CALL	_OSTimeDly 
	MAR	*- 
	.line	9 
	B	L3 
	.endfunc	90,000000000H,1 
 
	.sym	_TaskStk,_TaskStk,62,2,1600,,100 
	.globl	_TaskStk 
 
	.sym	_TestTaskStk,_TestTaskStk,62,2,1600,,100 
	.globl	_TestTaskStk 
****************************************************** 
* DEFINE STRING CONSTANTS                            * 
****************************************************** 
	.sect	".const" 
SL0:	.byte	"Inital End.",10,0 
SL1:	.byte	"MultiTask Start...",10,0 
SL2:	.byte	"led=%d",10,0 
SL3:	.byte	"This is Task!",10,0 
	.end