📄 system.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;
.public R_SpeechType;
.RAM
.var R_SpeechType;
.external R_Flag_A2000;
.external R_Flag_S480;
.CODE
.public _Set_SpeechType;
.public F_Set_SpeechType;
F_Set_SpeechType:
_Set_SpeechType: .PROC
push BP,BP to [SP]; //add if some parameters in
BP = SP + 1; //
r1 = [BP+3]; //
[R_SpeechType] = r1; //
pop BP,BP from [SP]; //
retf;
.ENDP
.public _System_Initial;
.public F_System_Initial;
_System_Initial: .PROC
F_System_Initial:
push BP,BP to [SP]; //add if some parameters in
call F_Key_Scan_Initial; // For keyboard scan
// Add other general initialization here
//BP = SP + 1;
//r1 = [BP+3];
call F_User_Init_IO;
//r1 =0x0001; // return value
pop BP,BP from [SP];
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 1 scan line
//call F_Key_Scan_ServiceLoop_2; // calling key scan subroutine 2 scan line
// Add other general service functions here
R1 = 0x0001; // Clear watch dog
[P_Watchdog_Clear] = R1; //
retf;
.ENDP;
.public F_User_Init_IO;
F_User_Init_IO:
R1 = 0xFE00; // IOB: b8 input, b9 output for PC-Play / SRAM addr.
[P_IOB_Dir] = R1; // IOB: output b15 .. b10 output
[P_IOB_Attrib] = R1;
R1 = 0x01FF;
[P_IOB_Data] = R1;
R1 = 0xff80; // IOA: b15 .. b8 :output SRAM data
[P_IOA_Dir] = R1; // IOA: b7: Key scan line
[P_IOA_Attrib] = R1; // IOA: b6 .. b4: CS*,OE*,WR
R1 = 0x0000; // IOA: b3 .. b0: Key input
[P_IOA_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 + -