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

📄 display.asm

📁 the sleep file .the program is used to goto sleep mode.
💻 ASM
字号:
//-----------------------------------------------------------------------
//Program Name:		LcdDisplay.asm
//Applied Body:		SPT6604A
//Project Description:	This is a Demo of Display in SPT6604A
//Compile:		Sunplus u'nSP IDE
//Programmer:		WangXu
//Current Version:	1.0
//Write Date:		2002/10/30
//-----------------------------------------------------------------------
.const			P_ColonSeg		= P_Seg24
.const			B_ColonCom		= B_Com7
.const			P_OutOfAreaSeg		= P_Seg8
.const			B_OutOfAreaCom		= B_Com3
.const			P_PrivateSeg		= P_Seg10
.const			B_PrivateCom		= B_Com3
.const			P_MessageSeg		= P_Seg14
.const			B_MessageCom		= B_Com3
//-----------------------------------------------------------------------
.code
F_ShowMessageFlag:
	r1 =	[P_MessageSeg]
	r1|=	B_MessageCom
	[P_MessageSeg] = r1
	retf
//-----------------------------------------------------------------------
F_ClrMessageFlag:
	r1 =	[P_MessageSeg]
	r1&=	0xffff-B_MessageCom
	[P_MessageSeg] = r1
	retf
//-----------------------------------------------------------------------	
F_ShowOutOfAreaFlag:
	r1 =	[P_OutOfAreaSeg]
	r1|=	B_OutOfAreaCom
	[P_OutOfAreaSeg] = r1 
	retf
//-----------------------------------------------------------------------
F_ShowPrivateFlag:
	r1 =	[P_PrivateSeg]
	r1|=	B_PrivateCom
	[P_PrivateSeg] = r1 
	retf
//-----------------------------------------------------------------------
F_ShowMonthDay:
	bp =	TW_MonthDay
?L_ShowMontDayLoop:
	r1 =	[bp++]
	jz	?L_ShowFlagOver
	r3 =	[bp++]
	r4 =	[r1]
	r4|=	r3
	[r1]	= r4
	jmp	?L_ShowMontDayLoop
?L_ShowFlagOver:
	retf
//-----------------------------------------------------------------------
F_ShowTime:
	bp =	TW_DigitTime
	r2 =	[RW_Time]
	test	r2,0x0f00
	jnz	?L_HourLowOk
	r2|=	0x0a00
?L_HourLowOk:
	test	r2,0x00f0
	jnz	?L_MinuteHighOk
	r2|=	0x00a0
?L_MinuteHighOk:
	test	r2,0x000f
	jnz	?L_MinuteLowOk
	r2|=	0x000a
?L_MinuteLowOk:
	jmp	L_ShowTwoDigit	
F_ShowDate:
	bp =	TW_DigitDate
	r2 =	[RW_Date]
	test	r2,0xf000
	jz	?L_MonthLowOk
	test	r2,0x0f00
	jnz	?L_MonthLowOk
	r2|=	0x0a00
?L_MonthLowOk:
	test	r2,0x00f0
	jz	L_ShowTwoDigit
	test	r2,0x000f
	jnz	L_ShowTwoDigit
	r2|=	0x000a
L_ShowTwoDigit:
	r1 =	r2 lsr 4
	r1 =	r1 lsr 4
	r1 =	r1 lsr 4
	r1 =	r1&0x000f
	call	F_ShowDigit
	r1 =	r2 lsr 4
	r1 =	r1 lsr 4
	r1 =	r1&0x000f
	call	F_ShowDigit
	r1 =	r2 lsr 4
	r1 =	r1&0x000f
	call	F_ShowDigit
	r1 =	r2&0x000f
	call	F_ShowDigit
	retf
//-----------------------------------------------------------------------
F_ShowDigit:
	R4 = 	R1+TB_Pattern0
	R1 =	[R4]		//Get pattern of corresponding number
?L_ShowPointLoop:
	R4 =	[BP++]		//Get display buffer address of current dot
	JZ	?L_ShowDigitOver//Digital display dots is over, subrotine over
	R3 =	[R4]		//Get display buffer content of current dot
	R4 =	[BP--]		//Get bit map in display buffer of current dot
	R3|=	R4		//Set bit of current dot
	TEST	R1,0x0001	//Test if current dot is display
	JNZ	?L_ShowDigit_30	//Yes, Display buffer content is Ok
	R4^=	0x00FF		//No, clear the bit
	R3&=	R4
?L_ShowDigit_30:
	R4 =	[BP++]		//Get display buffer address
	[R4]	= R3		//Put prepared content into the buffer
	BP+=	0x0001		//Skip bit map of current dot
	R1 =	R1 LSR 1	//shift pattern register so that next
				//dot can be test in next loop
	JMP	?L_ShowPointLoop
?L_ShowDigitOver:
	RETF;
//-----------------------------------------------------------------------
F_ClrLcd:
	r1 =	0x0000
	bp =	0x7100
?L_ClrLcdLoop:	
	[bp++]	= r1
	cmp	bp,0x711c
	jb	?L_ClrLcdLoop
	retf
//-----------------------------------------------------------------------
TB_Pattern0:      .DW      0x0000;
TB_Pattern1:      .DW      0x0028;
TB_Pattern2:      .DW      0x0073;
TB_Pattern3:      .DW      0x0079;
TB_Pattern4:      .DW      0x003C;
TB_Pattern5:      .DW      0x005D;
TB_Pattern6:      .DW      0x005F;
TB_Pattern7:      .DW      0x0068;
TB_Pattern8:      .DW      0x007F;
TB_Pattern9:      .DW      0x007D;
TB_PatternA:      .DW      0x00EF;
TB_PatternStar:   .DW      0x0003;
TB_PatternPound:  .DW      0x0009;
//-----------------------------------------------------------------------
TW_LcdPhoneDigit:
Digit0:  .DW      P_Seg0,B_Com0,P_Seg0,B_Com1,P_Seg0,B_Com2;
	.DW      P_Seg1,B_Com0,P_Seg1,B_Com1,P_Seg1,B_Com2,P_Seg1,B_Com3,0;
Digit1:  .DW      P_Seg2,B_Com0,P_Seg2,B_Com1,P_Seg2,B_Com2;
	.DW      P_Seg3,B_Com0,P_Seg3,B_Com1,P_Seg3,B_Com2,P_Seg3,B_Com3,0;
Digit2:  .DW      P_Seg4,B_Com0,P_Seg4,B_Com1,P_Seg4,B_Com2;
	.DW      P_Seg5,B_Com0,P_Seg5,B_Com1,P_Seg5,B_Com2,P_Seg5,B_Com3,0;
Digit3:  .DW      P_Seg6,B_Com0,P_Seg6,B_Com1,P_Seg6,B_Com2;
	.DW      P_Seg7,B_Com0,P_Seg7,B_Com1,P_Seg7,B_Com2,P_Seg7,B_Com3,0;
Digit4:  .DW      P_Seg8,B_Com0,P_Seg8,B_Com1,P_Seg8,B_Com2;
	.DW      P_Seg9,B_Com0,P_Seg9,B_Com1,P_Seg9,B_Com2,P_Seg9,B_Com3,0;
Digit5:  .DW      P_Seg10,B_Com0,P_Seg10,B_Com1,P_Seg10,B_Com2;
	.DW      P_Seg11,B_Com0,P_Seg11,B_Com1,P_Seg11,B_Com2,P_Seg11,B_Com3,0;
Digit6:  .DW      P_Seg12,B_Com0,P_Seg12,B_Com1,P_Seg12,B_Com2;
	.DW      P_Seg13,B_Com0,P_Seg13,B_Com1,P_Seg13,B_Com2,P_Seg13,B_Com3,0;
Digit7:  .DW      P_Seg14,B_Com0,P_Seg14,B_Com1,P_Seg14,B_Com2;
	.DW      P_Seg15,B_Com0,P_Seg15,B_Com1,P_Seg15,B_Com2,P_Seg15,B_Com3,0;
Digit8:  .DW      P_Seg16,B_Com0,P_Seg16,B_Com1,P_Seg16,B_Com2;
	.DW      P_Seg17,B_Com0,P_Seg17,B_Com1,P_Seg17,B_Com2,P_Seg17,B_Com3,0;
Digit9:  .DW      P_Seg18,B_Com0,P_Seg18,B_Com1,P_Seg18,B_Com2;
	.DW      P_Seg19,B_Com0,P_Seg19,B_Com1,P_Seg19,B_Com2,P_Seg19,B_Com3,0;
Digit10: .DW      P_Seg20,B_Com0,P_Seg20,B_Com1,P_Seg20,B_Com2;
	.DW      P_Seg21,B_Com0,P_Seg21,B_Com1,P_Seg21,B_Com2,P_Seg21,B_Com3,0;
Digit11: .DW      P_Seg22,B_Com0,P_Seg22,B_Com1,P_Seg22,B_Com2;
	.DW      P_Seg23,B_Com0,P_Seg23,B_Com1,P_Seg23,B_Com2,P_Seg23,B_Com3,0;
Digit12:
	.DW      P_Seg24,B_Com0,P_Seg24,B_Com1,P_Seg24,B_Com2;
	.DW      P_Seg25,B_Com0,P_Seg25,B_Com1,P_Seg25,B_Com2,P_Seg25,B_Com3,0;
Digit13:
	.DW      P_Seg26,B_Com0,P_Seg26,B_Com1,P_Seg26,B_Com2;
	.DW      P_Seg27,B_Com0,P_Seg27,B_Com1,P_Seg27,B_Com2,P_Seg27,B_Com3,0
TW_DigitDate:
	.DW	P_Seg10,B_Com8,P_Seg10,B_Com8,P_Seg10,B_Com8
	.DW	P_Seg11,B_Com4,P_Seg11,B_Com8,P_Seg11,B_Com6,P_Seg11,B_Com8,0
	.DW	P_Seg12,B_Com4,P_Seg12,B_Com5,P_Seg12,B_Com6
	.DW	P_Seg13,B_Com4,P_Seg13,B_Com5,P_Seg13,B_Com6,P_Seg13,B_Com7,0
	.DW	P_Seg14,B_Com4,P_Seg14,B_Com5,P_Seg14,B_Com6
	.DW	P_Seg15,B_Com4,P_Seg15,B_Com5,P_Seg15,B_Com6,P_Seg15,B_Com7,0
	.DW	P_Seg16,B_Com4,P_Seg16,B_Com5,P_Seg16,B_Com6
	.DW	P_Seg17,B_Com4,P_Seg17,B_Com5,P_Seg17,B_Com6,P_Seg17,B_Com7,0
TW_DigitTime:
	.DW	P_Seg20,B_Com4,P_Seg20,B_Com5,P_Seg20,B_Com6
	.DW	P_Seg21,B_Com4,P_Seg21,B_Com5,P_Seg21,B_Com6,P_Seg21,B_Com7,0
	.DW	P_Seg22,B_Com4,P_Seg22,B_Com5,P_Seg22,B_Com6
	.DW	P_Seg23,B_Com4,P_Seg23,B_Com5,P_Seg23,B_Com6,P_Seg23,B_Com7,0
	.DW	P_Seg24,B_Com4,P_Seg24,B_Com5,P_Seg24,B_Com6
	.DW	P_Seg25,B_Com4,P_Seg25,B_Com5,P_Seg25,B_Com6,P_Seg25,B_Com7,0
	.DW	P_Seg26,B_Com4,P_Seg26,B_Com5,P_Seg26,B_Com6
	.DW	P_Seg27,B_Com4,P_Seg27,B_Com5,P_Seg27,B_Com6,P_Seg27,B_Com7,0

TW_MonthDay:
	.DW	P_Seg14,B_Com7,P_Seg19,B_Com5,0



//-----------------------------------------------------------------------
//-----------------------------------------------------------------------

⌨️ 快捷键说明

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