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

📄 3310_8key_431.asm

📁 对于MEGE16中nokia3310的测试程序
💻 ASM
📖 第 1 页 / 共 2 页
字号:
;FastAVR Basic Compiler, ver.4.3.0, by MicroDesign
;Created 21:03:43, 06-09-2007
;
.include	"C:\FastAVR\inc\m16def.inc"
;
		.DSEG
n_key:					.byte	 1
n:						.byte	 1
x_:						.byte	 1
m:						.byte	 1
		
_fmtC:		.byte	1
_fmtD:		.byte	1
_lchr:		.byte	1
_s2tmp:		.byte	3
_fntL:		.byte	1
_fntH:		.byte	1

		.CSEG
.ORG	0x0000

_Reset:
		ldi		yl,byte1(RAMEND)
		out		SPL,yl
		ldi		yh,byte2(RAMEND)
		out		SPL+1,yh
		sbiw	yl,32
		sbi		DDRB, 7
		sbi		DDRB, 7
		ldi		zl,3
		sts		_fmtC,zl
		ldi		zl,0
		sts		_fmtD,zl
		ldi		zl,0x20
		sts		_lchr,zl

;******	USERS BASIC CODE **********************

;-Line--0024----n_key=255--
		ldi		zl,byte1(255)
		sts		n_key,zl

;-Line--0025----Set DDRB.4:Reset res: Nop 15: Set RES  '复位3310LCD--
		sbi		DDRB,4
		cbi		PORTB,6
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		nop
		sbi		PORTB,6

;-Line--0026----Set DDRD.7--
		sbi		DDRD,7

;-Line--0027----Reset led   '点亮3310背光灯--
		cbi		PORTD,7

;-Line--0028----GLcdInit    '初始化3310LCD--
		call	_NkIni

;-Line--0029----FontSet F0HD '选择字体--
		ldi		zl,byte1(f0hd*2)
		ldi		zh,byte2(f0hd*2)
		call	_Fnt

;-Line--0030----Contrast=n--
		lds		zl,n
		call	_Pcnst

;-Line--0031----Gcls--
		call	_PcCls

;-Line--0032----GLcd(0,5),"www.atmel.com" '显示一个字符串--
		ldi		r16,0
		ldi		r17,5
		ldi		zl,byte1(S000*2)
		ldi		zh,byte2(S000*2)
		call	_PcSc

;-Line--0033----ImgSet(0,0),dian--
		ldi		r16,0
		ldi		r17,0
		ldi		zl,byte1(dian*2)
		ldi		zh,byte2(dian*2)
		call	_Pcimg

;-Line--0034----ImgSet(15,0),ya--
		ldi		r16,15
		ldi		r17,0
		ldi		zl,byte1(ya*2)
		ldi		zh,byte2(ya*2)
		call	_Pcimg

;-Line--0036----n=60--
		ldi		zl,byte1(60)
		sts		n,zl

;-Line--0037----Do--
L0000:

;-Line--0038----Contrast=n--
		lds		zl,n
		call	_Pcnst

;-Line--0039----GLcd(0,3),"key=";n_key   '显示键值--
		ldi		r16,0
		ldi		r17,3
		ldi		zl,byte1(S001*2)
		ldi		zh,byte2(S001*2)
		call	_PcSc
		lds		zl,n_key
		call	_B2Str
		call	_PcBW

;-Line--0040----GLcd(60, 0), n  ' 显示一个变量n好观察3310有没有运行--
		ldi		r16,60
		ldi		r17,0
		lds		zl,n
		call	_B2Str
		call	_PcBW

;-Line--0041----Incr n--
		lds		zl,n
		inc		zl
		sts		n,zl

;-Line--0042----If n>80 Then n=60--
		lds		r24,n
		ldi		zl,byte1(80)
		inc		zl
		cp		r24,zl
		brsh	PC+0x02
		rjmp	L0003
L0004:
		ldi		zl,byte1(60)
		sts		n,zl
L0003:

;-Line--0043----Reset SL--
		cbi		PORTB,4

;-Line--0044----Set SL       ' 锁存74HC165--
		sbi		PORTB,4

;-Line--0045----Reset DDRB.5  '将SDIN变为输入为读取74HC165做准备--
		cbi		DDRB,5

;-Line--0047----n_key=ShiftIn  '获得键值--
		call	_Sin
		sts		n_key,zl

;-Line--0048----n_key=Not n_key--
		lds		zl,n_key
		com		zl
		sts		n_key,zl

;-Line--0049----WaitMs 30--
		ldi		zl,byte1(30)
		call	_Wms

;-Line--0050----Set DDRB.5 '将SDIN变为输出为写3310LCD做准备--
		sbi		DDRB,5

;-Line--0054----ImgSet(60, 2, m), Sclk1616HD--
		ldi		r16,60
		ldi		r17,2
		lds		r20,m
		ldi		zl,byte1(sclk1616hd*2)
		ldi		zh,byte2(sclk1616hd*2)
		call	_PcimA

;-Line--0055----Incr m--
		lds		zl,m
		inc		zl
		sts		m,zl

;-Line--0056----If m>7 Then m=0--
		lds		r24,m
		ldi		zl,byte1(7)
		inc		zl
		cp		r24,zl
		brsh	PC+0x02
		rjmp	L0006
L0007:
		ldi		zl,byte1(0)
		sts		m,zl
L0006:

;-Line--0057----WaitMs 30--
		ldi		zl,byte1(30)
		call	_Wms

;-Line--0059----Loop--
		rjmp	L0000
L0001:

;-Line--0061----$Include "C:\FastAVR\F0HD.bas"--

;-Line--0002----F0HD = 5, 1,	' Font Table Name, Width, Height in Lines, 482 bytes--
f0hd:
		.db	0x05,0x01
;-Line--0003----&h00,&h00,&h00,&h00,&h00,&h00,--
		.db	0x00,0x00,0x00,0x00,0x00,0x00
;-Line--0004----&h00,&h5F,&h00,&h00,&h00,&h03,--
		.db	0x00,0x5f,0x00,0x00,0x00,0x03
;-Line--0005----&h00,&h03,&h00,&h14,&h7F,&h14,--
		.db	0x00,0x03,0x00,0x14,0x7f,0x14
;-Line--0006----&h7F,&h14,&h44,&h4A,&hFF,&h52,--
		.db	0x7f,0x14,0x44,0x4a,0xff,0x52
;-Line--0007----&h22,&h23,&h13,&h08,&h64,&h62,--
		.db	0x22,0x23,0x13,0x08,0x64,0x62
;-Line--0008----&h36,&h49,&h55,&h22,&h50,&h00,--
		.db	0x36,0x49,0x55,0x22,0x50,0x00
;-Line--0009----&h00,&h05,&h03,&h00,&h00,&h1C,--
		.db	0x00,0x05,0x03,0x00,0x00,0x1c
;-Line--0010----&h22,&h41,&h00,&h00,&h00,&h41,--
		.db	0x22,0x41,0x00,0x00,0x00,0x41
;-Line--0011----&h22,&h1C,&h14,&h08,&h3E,&h08,--
		.db	0x22,0x1c,0x14,0x08,0x3e,0x08
;-Line--0012----&h14,&h08,&h08,&h3E,&h08,&h08,--
		.db	0x14,0x08,0x08,0x3e,0x08,0x08
;-Line--0013----&h00,&hA0,&h60,&h00,&h00,&h08,--
		.db	0x00,0xa0,0x60,0x00,0x00,0x08
;-Line--0014----&h08,&h08,&h08,&h08,&h00,&h60,--
		.db	0x08,0x08,0x08,0x08,0x00,0x60
;-Line--0015----&h60,&h00,&h00,&h20,&h10,&h08,--
		.db	0x60,0x00,0x00,0x20,0x10,0x08
;-Line--0016----&h04,&h02,&h3E,&h51,&h49,&h45,--
		.db	0x04,0x02,0x3e,0x51,0x49,0x45
;-Line--0017----&h3E,&h00,&h42,&h7F,&h40,&h00,--
		.db	0x3e,0x00,0x42,0x7f,0x40,0x00
;-Line--0018----&h42,&h61,&h51,&h49,&h46,&h21,--
		.db	0x42,0x61,0x51,0x49,0x46,0x21
;-Line--0019----&h41,&h45,&h4B,&h31,&h18,&h14,--
		.db	0x41,0x45,0x4b,0x31,0x18,0x14
;-Line--0020----&h12,&h7F,&h10,&h27,&h45,&h45,--
		.db	0x12,0x7f,0x10,0x27,0x45,0x45
;-Line--0021----&h45,&h39,&h3C,&h4A,&h49,&h49,--
		.db	0x45,0x39,0x3c,0x4a,0x49,0x49
;-Line--0022----&h30,&h01,&h71,&h09,&h05,&h03,--
		.db	0x30,0x01,0x71,0x09,0x05,0x03
;-Line--0023----&h36,&h49,&h49,&h49,&h36,&h06,--
		.db	0x36,0x49,0x49,0x49,0x36,0x06
;-Line--0024----&h49,&h49,&h29,&h1E,&h00,&h36,--
		.db	0x49,0x49,0x29,0x1e,0x00,0x36
;-Line--0025----&h36,&h00,&h00,&h00,&hA6,&h66,--
		.db	0x36,0x00,0x00,0x00,0xa6,0x66
;-Line--0026----&h00,&h00,&h08,&h14,&h22,&h41,--
		.db	0x00,0x00,0x08,0x14,0x22,0x41
;-Line--0027----&h00,&h14,&h14,&h14,&h14,&h14,--
		.db	0x00,0x14,0x14,0x14,0x14,0x14
;-Line--0028----&h41,&h22,&h14,&h08,&h00,&h02,--
		.db	0x41,0x22,0x14,0x08,0x00,0x02
;-Line--0029----&h01,&h51,&h09,&h06,&h42,&h63,--
		.db	0x01,0x51,0x09,0x06,0x42,0x63
;-Line--0030----&h52,&h4B,&h46,&h7E,&h11,&h11,--
		.db	0x52,0x4b,0x46,0x7e,0x11,0x11
;-Line--0031----&h11,&h7E,&h7F,&h49,&h49,&h49,--
		.db	0x11,0x7e,0x7f,0x49,0x49,0x49
;-Line--0032----&h36,&h3E,&h41,&h41,&h41,&h22,--
		.db	0x36,0x3e,0x41,0x41,0x41,0x22
;-Line--0033----&h7F,&h41,&h41,&h22,&h1C,&h7F,--
		.db	0x7f,0x41,0x41,0x22,0x1c,0x7f
;-Line--0034----&h49,&h49,&h49,&h41,&h7F,&h09,--
		.db	0x49,0x49,0x49,0x41,0x7f,0x09
;-Line--0035----&h09,&h09,&h01,&h3E,&h41,&h49,--
		.db	0x09,0x09,0x01,0x3e,0x41,0x49
;-Line--0036----&h49,&h7A,&h7F,&h08,&h08,&h08,--
		.db	0x49,0x7a,0x7f,0x08,0x08,0x08
;-Line--0037----&h7F,&h00,&h41,&h7F,&h41,&h00,--
		.db	0x7f,0x00,0x41,0x7f,0x41,0x00
;-Line--0038----&h20,&h40,&h41,&h3F,&h01,&h7F,--
		.db	0x20,0x40,0x41,0x3f,0x01,0x7f
;-Line--0039----&h08,&h14,&h22,&h41,&h7F,&h40,--
		.db	0x08,0x14,0x22,0x41,0x7f,0x40
;-Line--0040----&h40,&h40,&h40,&h7F,&h02,&h0C,--
		.db	0x40,0x40,0x40,0x7f,0x02,0x0c
;-Line--0041----&h02,&h7F,&h7F,&h04,&h08,&h10,--
		.db	0x02,0x7f,0x7f,0x04,0x08,0x10
;-Line--0042----&h7F,&h3E,&h41,&h41,&h41,&h3E,--
		.db	0x7f,0x3e,0x41,0x41,0x41,0x3e
;-Line--0043----&h7F,&h09,&h09,&h09,&h06,&h3E,--
		.db	0x7f,0x09,0x09,0x09,0x06,0x3e
;-Line--0044----&h41,&h51,&h21,&h5E,&h7F,&h09,--
		.db	0x41,0x51,0x21,0x5e,0x7f,0x09
;-Line--0045----&h19,&h29,&h46,&h26,&h49,&h49,--
		.db	0x19,0x29,0x46,0x26,0x49,0x49
;-Line--0046----&h49,&h32,&h01,&h01,&h7F,&h01,--
		.db	0x49,0x32,0x01,0x01,0x7f,0x01
;-Line--0047----&h01,&h3F,&h40,&h40,&h40,&h3F,--
		.db	0x01,0x3f,0x40,0x40,0x40,0x3f
;-Line--0048----&h1F,&h20,&h40,&h20,&h1F,&h3F,--
		.db	0x1f,0x20,0x40,0x20,0x1f,0x3f
;-Line--0049----&h40,&h38,&h40,&h3F,&h63,&h14,--
		.db	0x40,0x38,0x40,0x3f,0x63,0x14
;-Line--0050----&h08,&h14,&h63,&h07,&h08,&h70,--
		.db	0x08,0x14,0x63,0x07,0x08,0x70
;-Line--0051----&h08,&h07,&h61,&h51,&h49,&h45,--
		.db	0x08,0x07,0x61,0x51,0x49,0x45
;-Line--0052----&h43,&h48,&h56,&h54,&h56,&h24,--
		.db	0x43,0x48,0x56,0x54,0x56,0x24
;-Line--0053----&h02,&h04,&h08,&h10,&h20,&h3C,--
		.db	0x02,0x04,0x08,0x10,0x20,0x3c
;-Line--0054----&h42,&h42,&h43,&h24,&h3C,&h43,--
		.db	0x42,0x42,0x43,0x24,0x3c,0x43
;-Line--0055----&h42,&h43,&h24,&h80,&h80,&h80,--
		.db	0x42,0x43,0x24,0x80,0x80,0x80
;-Line--0056----&h80,&h80,&h44,&h65,&h56,&h4D,--
		.db	0x80,0x80,0x44,0x65,0x56,0x4d
;-Line--0057----&h44,&h30,&h54,&h54,&h54,&h78,--
		.db	0x44,0x30,0x54,0x54,0x54,0x78
;-Line--0058----&h7F,&h44,&h44,&h44,&h38,&h38,--
		.db	0x7f,0x44,0x44,0x44,0x38,0x38
;-Line--0059----&h44,&h44,&h44,&h44,&h38,&h44,--
		.db	0x44,0x44,0x44,0x44,0x38,0x44
;-Line--0060----&h44,&h44,&h7F,&h38,&h54,&h54,--
		.db	0x44,0x44,0x7f,0x38,0x54,0x54
;-Line--0061----&h54,&h18,&h04,&h04,&h7E,&h05,--
		.db	0x54,0x18,0x04,0x04,0x7e,0x05
;-Line--0062----&h05,&h18,&hA4,&hA4,&hA4,&h7C,--
		.db	0x05,0x18,0xa4,0xa4,0xa4,0x7c
;-Line--0063----&h7F,&h08,&h04,&h04,&h78,&h00,--
		.db	0x7f,0x08,0x04,0x04,0x78,0x00
;-Line--0064----&h44,&h7D,&h40,&h00,&h40,&h80,--
		.db	0x44,0x7d,0x40,0x00,0x40,0x80
;-Line--0065----&h84,&h7D,&h00,&h7F,&h10,&h28,--
		.db	0x84,0x7d,0x00,0x7f,0x10,0x28
;-Line--0066----&h44,&h00,&h00,&h41,&h7F,&h40,--
		.db	0x44,0x00,0x00,0x41,0x7f,0x40
;-Line--0067----&h00,&h7C,&h04,&h7C,&h04,&h78,--
		.db	0x00,0x7c,0x04,0x7c,0x04,0x78
;-Line--0068----&h7C,&h08,&h04,&h04,&h78,&h38,--
		.db	0x7c,0x08,0x04,0x04,0x78,0x38
;-Line--0069----&h44,&h44,&h44,&h38,&hFC,&h24,--
		.db	0x44,0x44,0x44,0x38,0xfc,0x24
;-Line--0070----&h24,&h24,&h18,&h18,&h24,&h24,--
		.db	0x24,0x24,0x18,0x18,0x24,0x24
;-Line--0071----&h24,&hFC,&h7C,&h08,&h04,&h04,--
		.db	0x24,0xfc,0x7c,0x08,0x04,0x04
;-Line--0072----&h00,&h48,&h54,&h54,&h54,&h24,--
		.db	0x00,0x48,0x54,0x54,0x54,0x24
;-Line--0073----&h04,&h04,&h3F,&h44,&h44,&h3C,--
		.db	0x04,0x04,0x3f,0x44,0x44,0x3c
;-Line--0074----&h40,&h40,&h20,&h7C,&h1C,&h20,--
		.db	0x40,0x40,0x20,0x7c,0x1c,0x20
;-Line--0075----&h40,&h20,&h1C,&h3C,&h40,&h30,--
		.db	0x40,0x20,0x1c,0x3c,0x40,0x30
;-Line--0076----&h40,&h3C,&h44,&h28,&h10,&h28,--

⌨️ 快捷键说明

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