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

📄 test.s

📁 基于AVR和51的240*128液晶显示模块驱动程序。很有用的喔~
💻 S
📖 第 1 页 / 共 3 页
字号:
	lsl R24
	rol R25
	lsl R24
	rol R25
	adiw R24,6
	add R20,R24
	adc R21,R25
	xjmp L77
L76:
; }
; }
	movw R2,R10
	movw R24,R2
	adiw R24,1
	movw R10,R24
	movw R4,R22
	subi R22,1
	sbci R23,0
	movw R24,R2
	sub R24,R4
	sbc R25,R5
	lsl R24
	rol R25
	lsl R24
	rol R25
	adiw R24,10
	add R20,R24
	adc R21,R25
L77:
L74:
	cp R22,R10
	cpc R23,R11
	brlt X0
	xjmp L73
X0:
L72:
	adiw R28,1
	xcall pop_gset5
	adiw R28,4
	.dbline 0 ; func end
	ret
;           fill -> y+21
;           draw -> R12
;             y2 -> R22
;             x2 -> R10
;             y1 -> R14
;             x1 -> R20
	.even
_Lcd_Box::
	xcall push_gset5
	mov R14,R18
	mov R20,R16
	sbiw R28,5
	ldd R10,y+15
	ldd R22,y+17
	ldd R12,y+19
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
	ldd R0,y+21
	tst R0
	breq L79
; }
	xjmp L84
L81:
	std y+4,R12
	std y+2,R22
	std y+0,R20
	mov R18,R14
	mov R16,R20
	xcall _Lcd_Line
L82:
	inc R20
L84:
; }
	cp R20,R10
	brne L81
; }
	xjmp L80
L79:
; }
; }
; }
	std y+4,R12
	std y+2,R22
	std y+0,R20
	mov R18,R14
	mov R16,R20
	xcall _Lcd_Line
; }
	std y+4,R12
	std y+2,R14
	std y+0,R10
	mov R18,R14
	mov R16,R20
	xcall _Lcd_Line
; }
	std y+4,R12
	std y+2,R22
	std y+0,R10
	mov R18,R14
	mov R16,R10
	xcall _Lcd_Line
; }
	std y+4,R12
	std y+2,R22
	std y+0,R10
	mov R18,R22
	mov R16,R20
	xcall _Lcd_Line
; }
L80:
L78:
	adiw R28,5
	xcall pop_gset5
	.dbline 0 ; func end
	ret
	.even
_Lcd_Setup::
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
	in R24,0x17
	ori R24,15
	out 0x17,R24
; }
	in R24,0x18
	ori R24,15
	out 0x18,R24
; }
	ldi R24,255
	out 0x14,R24
L85:
	.dbline 0 ; func end
	ret
	.even
_Lcd_Init::
	sbiw R28,1
; }
; }
; }
; }
; }
; }
	xcall _Lcd_ClrScreen
; }
; }
; }
; }
	ldi R24,64
	std y+0,R24
	clr R18
	clr R16
	xcall _Lcd_SendCom2
; }
	ldi R24,65
	std y+0,R24
	clr R18
	ldi R16,30
	xcall _Lcd_SendCom2
; }
	ldi R24,66
	std y+0,R24
	ldi R18,3
	ldi R16,0
	xcall _Lcd_SendCom2
; }
	ldi R24,67
	std y+0,R24
	clr R18
	ldi R16,30
	xcall _Lcd_SendCom2
; }
; }
	xcall _Lcd_ClrText
; }
	xcall _Lcd_ClrGraph
; }
; }
	ldi R16,167
	xcall _Lcd_SendCom0
; }
	ldi R16,129
	xcall _Lcd_SendCom0
; }
	ldi R16,156
	xcall _Lcd_SendCom0
L86:
	adiw R28,1
	.dbline 0 ; func end
	ret
	.area data(ram, con, rel)
_PTSTR::
	.blkb 23
	.area idata
	.byte 'H,'e,'l,'l,'o,32,'e,'v,'e,'r,32,'b,'o,'d,'y,44
	.byte 'I,39,'m,32,'R,'J,0
	.area data(ram, con, rel)
	.area text(rom, con, rel)
;              b -> R20
;              a -> R22
;              d -> R10
;              c -> R12
	.even
_main::
	sbiw R28,7
	xcall _avr_init
	ldi R24,<_PTSTR
	ldi R25,>_PTSTR
	std y+1,R25
	std y+0,R24
	ldi R18,2
	ldi R16,10
	xcall _Lcd_PrintText
	ldi R24,1
	std y+4,R24
	ldi R24,127
	std y+2,R24
	ldi R24,239
	std y+0,R24
	clr R18
	clr R16
	xcall _Lcd_Line
	ldi R24,1
	std y+4,R24
	clr R2
	std y+2,R2
	ldi R24,239
	std y+0,R24
	ldi R18,127
	clr R16
	xcall _Lcd_Line
	ldi R24,1
	std y+4,R24
	ldi R24,64
	std y+2,R24
	ldi R24,239
	std y+0,R24
	ldi R18,64
	clr R16
	xcall _Lcd_Line
	ldi R24,1
	std y+4,R24
	ldi R24,127
	std y+2,R24
	ldi R24,120
	std y+0,R24
	clr R18
	ldi R16,120
	xcall _Lcd_Line
	ldi R24,1
	std y+2,R24
	ldi R24,30
	std y+0,R24
	ldi R18,64
	ldi R16,120
	xcall _Lcd_Circle
	clr R2
	std y+6,R2
	ldi R24,1
	std y+4,R24
	ldi R24,125
	std y+2,R24
	ldi R24,237
	std y+0,R24
	ldi R18,2
	ldi R16,2
	xcall _Lcd_Box
	ldi R24,1
	std y+6,R24
	std y+4,R24
	ldi R24,74
	std y+2,R24
	ldi R24,130
	std y+0,R24
	ldi R18,54
	ldi R16,110
	xcall _Lcd_Box
	ldi R24,1
	std y+6,R24
	clr R2
	std y+4,R2
	ldi R24,69
	std y+2,R24
	ldi R24,125
	std y+0,R24
	ldi R18,59
	ldi R16,115
	xcall _Lcd_Box
	ldi R24,1
	std y+0,R24
	clr R18
	clr R16
	xcall _Lcd_Point
	ldi R22,75
	ldi R20,1
	ldi R24,5
	mov R12,R24
	ldi R24,64
	mov R10,R24
	clr R2
	std y+6,R2
	ldi R24,1
	std y+4,R24
	ldi R24,120
	std y+2,R24
	ldi R24,116
	std y+0,R24
	ldi R18,63
	ldi R16,4
	xcall _Lcd_Box
	xjmp L89
L88:
	std y+4,R20
	ldi R24,26
	std y+2,R24
	std y+0,R22
	ldi R18,14
	mov R16,R22
	xcall _Lcd_Line
	mov R2,R22
	clr R3
	subi R22,255    ; addi 1
	mov R24,R2
	cpi R24,232
	brne L91
	ldi R22,75
	ldi R24,1
	sub R24,R20
	mov R20,R24
L91:
	mov R24,R12
	cpi R24,115
	brsh L93
	ldi R24,1
	std y+4,R24
	mov R2,R10
	clr R3
	ldi R24,183
	ldi R25,0
	sub R24,R2
	sbc R25,R3
	std y+2,R24
	ldi R24,120
	sub R24,R12
	std y+0,R24
	mov R18,R2
	mov R16,R12
	xcall _Lcd_Line
	ldi R16,250
	xcall _delay_us
	clr R2
	std y+4,R2
	mov R2,R10
	clr R3
	ldi R24,183
	ldi R25,0
	sub R24,R2
	sbc R25,R3
	std y+2,R24
	ldi R24,120
	sub R24,R12
	std y+0,R24
	mov R18,R2
	mov R16,R12
	xcall _Lcd_Line
	inc R12
	xjmp L94
L93:
	ldi R24,1
	std y+4,R24
	mov R2,R10
	clr R3
	ldi R24,183
	ldi R25,0
	sub R24,R2
	sbc R25,R3
	std y+2,R24
	ldi R24,120
	sub R24,R12
	std y+0,R24
	mov R18,R2
	mov R16,R12
	xcall _Lcd_Line
	ldi R16,250
	xcall _delay_us
	clr R2
	std y+4,R2
	mov R2,R10
	clr R3
	ldi R24,183
	ldi R25,0
	sub R24,R2
	sbc R25,R3
	std y+2,R24
	ldi R24,120
	sub R24,R12
	std y+0,R24
	mov R18,R2
	mov R16,R12
	xcall _Lcd_Line
	inc R10
	mov R24,R10
	cpi R24,120
	brlo L95
	ldi R24,64
	mov R10,R24
	ldi R24,5
	mov R12,R24
L95:
L94:
L89:
	xjmp L88
X1:
L87:
	adiw R28,7
	.dbline 0 ; func end
	ret
	.even
_avr_init::
	xcall _Lcd_Setup
	xcall _Lcd_Init
L97:
	.dbline 0 ; func end
	ret

⌨️ 快捷键说明

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