⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 system.asm

📁 陵阳单片机的语音编程的一个例子程序
💻 ASM
字号:
//////////////////////////////////////////////////////////////////
// Function: System commander                     
// 	Service for H/W, keyboard scan
// Input: None
// Output: None

// Functions:
//	(In Assembly view)
// 	call F_System_Initial; 
//	(In C language view)
// 	System_Initial(); 
//////////////////////////////////////////////////////////////////
.include resource.inc;
.include hardware.inc;
.include key.inc;

.external F_SACM_MS01_SetInstrument;
.external F_SACM_MS01_ChannelOn;
.external F_SACM_MS01_ChannelOff;

.public R_SpeechType;
.RAM
.VAR R_SpeechType;

.CODE
.public _U_System_Initial;
.public	F_U_System_Initial;
_U_System_Initial: .PROC
F_U_System_Initial:
//		call	F_Key_Scan_Initial;			// For keyboard scan
//		call	F_User_Init_IO;				// User define IO
  		R1 = 0x0005
  		[P_TimerB_Ctrl] = R1
  		R1 = 0xFFFF
  		[P_TimerB_Data] = R1

  		R1 = 0x2810
  		[P_INT_Ctrl] = R1
		retf;
		.ENDP;
.public _Int_Off
_Int_Off:	.PROC
		R1 =0x0000
		[P_INT_Ctrl] = R1
		retf;
		.ENDP;

//****************************************************************
// Function: Main Loop of system                     
// Input: None
// Output: None
// Using:
// 	call F_System_ServiceLoop; (in assembly domain)
//  System_ServiceLoop(); (in C domain) 	
//****************************************************************
.public _System_ServiceLoop;
.public	F_System_ServiceLoop;
_System_ServiceLoop: .PROC                  
F_System_ServiceLoop:
		call	F_Key_DebounceCnt_Down;		// calling debounce subroutine for key scan subroutine
		call    F_Key_Scan_ServiceLoop;		// calling key scan subroutine 
		// Add other general service functions here		
		R1 = 0x0001;                      // Clear watch dog
		[P_Watchdog_Clear] = R1;       	//
        retf;
        .ENDP;
        
F_User_Init_IO:        
		R1 = 0x0000;					// IOA[15..0] input
        [P_IOA_Dir] = R1;				// 
        [P_IOA_Attrib] = R1;
        [P_IOA_Data] = R1;
        R1 = 0x0000;					// IOB[15..0] input
        [P_IOB_Dir] = R1;				// 
        [P_IOB_Attrib] = R1;			
        [P_IOB_Data] = R1;    
        RETF;     
//=====================================================================================
//函数:F_ClearWatchdog ()
//语法:void F_ClearWatchdog (void)
//描述:看清门狗
//参数:无
//返回:无
//=====================================================================================      
.code 
.public _F_ClearWatchdog;
 _F_ClearWatchdog: .proc
        R1 = 0x0001;
        [P_Watchdog_Clear] = R1;
        RETF;
.ENDP      

⌨️ 快捷键说明

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