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

📄 main.s

📁 基于mega128上实现ad7705的驱动程序
💻 S
📖 第 1 页 / 共 2 页
字号:
;              x -> R22
	.even
_LCD_DisplayString::
	xcall push_gset3
	mov R10,R18
	mov R22,R16
	ldd R20,y+6
	ldd R21,y+7
	.dbline -1
	.dbline 120
	.dbline 121
	mov R18,R10
	mov R16,R22
	xcall _LCD_set_xy
	xjmp L87
L86:
	.dbline 123
	movw R30,R20
	ld R16,Z+
	movw R20,R30
	xcall _LCD_DisplayCharacter
L87:
	.dbline 122
	movw R30,R20
	ldd R2,z+0
	tst R2
	brne L86
	.dbline -2
L85:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r string 20 pc
	.dbsym r y 10 c
	.dbsym r x 22 c
	.dbend
	.dbfunc e LCD_DisplayInt _LCD_DisplayInt fV
;              n -> R22
;              j -> R22
;            str -> R10,R11
;              a -> y+2
;              i -> R20
;              t -> R20,R21
;              y -> R14
;              x -> R12
	.even
_LCD_DisplayInt::
	xcall push_gset5
	mov R14,R18
	mov R12,R16
	sbiw R28,7
	ldd R20,y+17
	ldd R21,y+18
	.dbline -1
	.dbline 134
;  
;  
;  
;  
;  
;  
;  
	.dbline 137
;  
;  
;  
	ldi R24,<_ch1
	ldi R25,>_ch1
	movw R10,R24
	.dbline 138
;  
	ldi R18,10000
	ldi R19,39
	movw R16,R20
	xcall div16u
	ldi R18,10
	ldi R19,0
	xcall mod16u
	std y+2,R16
	.dbline 139
;  
	ldi R18,1000
	ldi R19,3
	movw R16,R20
	xcall div16u
	ldi R18,10
	ldi R19,0
	xcall mod16u
	std y+3,R16
	.dbline 140
;  
	ldi R18,100
	ldi R19,0
	movw R16,R20
	xcall div16u
	ldi R18,10
	ldi R19,0
	xcall mod16u
	std y+4,R16
	.dbline 141
;  
	ldi R18,10
	ldi R19,0
	movw R16,R20
	xcall div16u
	ldi R18,10
	ldi R19,0
	xcall mod16u
	std y+5,R16
	.dbline 142
;  
	ldi R18,10
	ldi R19,0
	movw R16,R20
	xcall mod16u
	std y+6,R16
	.dbline 144
;  
;  
	clr R20
	xjmp L97
L94:
	.dbline 145
	movw R24,R28
	adiw R24,2
	mov R2,R20
	clr R3
	add R2,R24
	adc R3,R25
	movw R30,R2
	ldd R24,z+0
	subi R24,208    ; addi 48
	std z+0,R24
L95:
	.dbline 144
	inc R20
L97:
	.dbline 144
	cpi R20,5
	brlo L94
	.dbline 146
	clr R20
	xjmp L101
L98:
	.dbline 146
L99:
	.dbline 146
	inc R20
L101:
	.dbline 146
;  
;  
	movw R24,R28
	adiw R24,2
	mov R30,R20
	clr R31
	add R30,R24
	adc R31,R25
	ldd R24,z+0
	cpi R24,48
	brne L102
	ldi R24,3
	cp R24,R20
	brsh L98
L102:
	.dbline 147
;  
	ldi R22,5
	sub R22,R20
	.dbline 148
;  
	ldi R24,5
	sub R24,R22
	mov R22,R24
	xjmp L106
L103:
	.dbline 149
	.dbline 149
	ldi R24,32
	movw R30,R10
	std z+0,R24
	.dbline 149
	movw R24,R30
	adiw R24,1
	movw R10,R24
	.dbline 149
L104:
	.dbline 148
	inc R22
L106:
	.dbline 148
	cp R22,R20
	brlo L103
	.dbline 150
;  
;  
	xjmp L110
L107:
	.dbline 151
	.dbline 151
	movw R24,R28
	adiw R24,2
	mov R30,R20
	clr R31
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	movw R30,R10
	std z+0,R2
	.dbline 151
	movw R24,R30
	adiw R24,1
	movw R10,R24
	.dbline 151
L108:
	.dbline 150
	inc R20
L110:
	.dbline 150
	cpi R20,5
	brlo L107
	.dbline 152
;  
;  
	clr R2
	movw R30,R10
	std z+0,R2
	.dbline 153
;  
	ldi R24,<_ch1
	ldi R25,>_ch1
	std y+1,R25
	std y+0,R24
	mov R18,R14
	mov R16,R12
	xcall _LCD_DisplayString
	.dbline -2
L89:
	adiw R28,7
	xcall pop_gset5
	.dbline 0 ; func end
	ret
	.dbsym r n 22 c
	.dbsym r j 22 c
	.dbsym r str 10 pc
	.dbsym l a 2 A[5:5]c
	.dbsym r i 20 c
	.dbsym r t 20 i
	.dbsym r y 14 c
	.dbsym r x 12 c
	.dbend
	.dbfunc e LCD_Displayasc _LCD_Displayasc fV
;           temp -> R10
;          ascii -> y+2
;            asc -> y+10
;              y -> R22
;              x -> R20
	.even
_LCD_Displayasc::
	xcall push_gset3
	mov R22,R18
	mov R20,R16
	sbiw R28,4
	.dbline -1
	.dbline 163
;  
;  
;  
;  
;  
;  
;  
;  
;  
;  
	.dbline 164
;  
	ldd R10,y+10
	.dbline 165
;  
	mov R24,R10
	subi R24,208    ; addi 48
	std y+2,R24
	.dbline 166
;  
	clr R2
	std y+3,R2
	.dbline 167
;  
	movw R24,R28
	adiw R24,2
	std y+1,R25
	std y+0,R24
	mov R18,R22
	mov R16,R20
	xcall _LCD_DisplayString
	.dbline -2
L111:
	adiw R28,4
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym r temp 10 c
	.dbsym l ascii 2 A[2:2]c
	.dbsym l asc 10 c
	.dbsym r y 22 c
	.dbsym r x 20 c
	.dbend
	.dbfunc e LCD_DisplayLong _LCD_DisplayLong fV
;              n -> R10
;              j -> R10
;            str -> R12,R13
;              a -> y+2
;              i -> R14
;              t -> y+24
;              y -> y+22
;              x -> y+20
	.even
_LCD_DisplayLong::
	xcall push_arg4
	xcall push_gset5
	sbiw R28,10
	.dbline -1
	.dbline 178
;  
;  
;  
;  
;  
;  
;  
;  
;  
;  
;  
	.dbline 182
;  
;  
;  
;  
	ldi R24,<_ch2
	ldi R25,>_ch2
	movw R12,R24
	.dbline 183
;  
	ldi R20,128
	ldi R21,150
	ldi R22,152
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+2,R16
	.dbline 184
;  
	ldi R20,64
	ldi R21,66
	ldi R22,15
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+3,R16
	.dbline 185
;  
	ldi R20,160
	ldi R21,134
	ldi R22,1
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+4,R16
	.dbline 186
;  
	ldi R20,16
	ldi R21,39
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+5,R16
	.dbline 187
;  
	ldi R20,232
	ldi R21,3
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+6,R16
	.dbline 188
;  
	ldi R20,100
	ldi R21,0
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+7,R16
	.dbline 189
;  
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall div32u
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	xcall mod32u
	std y+8,R16
	.dbline 190
;  
	ldi R20,10
	ldi R21,0
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+24
	ldd R3,z+25
	ldd R4,z+26
	ldd R5,z+27
	st -y,R23
	st -y,R22
	st -y,R21
	st -y,R20
	movw R16,R2
	movw R18,R4
	xcall mod32u
	std y+9,R16
	.dbline 192
;  
;  
	clr R14
	xjmp L124
L121:
	.dbline 193
	movw R24,R28
	adiw R24,2
	mov R2,R14
	clr R3
	add R2,R24
	adc R3,R25
	movw R30,R2
	ldd R24,z+0
	subi R24,208    ; addi 48
	std z+0,R24
L122:
	.dbline 192
	inc R14
L124:
	.dbline 192
	mov R24,R14
	cpi R24,8
	brlo L121
	.dbline 194
	clr R14
	xjmp L128
L125:
	.dbline 194
L126:
	.dbline 194
	inc R14
L128:
	.dbline 194
;  
;  
	movw R24,R28
	adiw R24,2
	mov R30,R14
	clr R31
	add R30,R24
	adc R31,R25
	ldd R24,z+0
	cpi R24,48
	brne L129
	ldi R24,7
	cp R24,R14
	brsh L125
L129:
	.dbline 195
;  
	ldi R24,8
	mov R10,R24
	sub R10,R14
	.dbline 196
;  
	sub R24,R10
	mov R10,R24
	xjmp L133
L130:
	.dbline 197
	.dbline 197
	ldi R24,32
	movw R30,R12
	std z+0,R24
	.dbline 197
	movw R24,R30
	adiw R24,1
	movw R12,R24
	.dbline 197
L131:
	.dbline 196
	inc R10
L133:
	.dbline 196
	cp R10,R14
	brlo L130
	.dbline 198
;  
;  
	xjmp L137
L134:
	.dbline 199
	.dbline 199
	movw R24,R28
	adiw R24,2
	mov R30,R14
	clr R31
	add R30,R24
	adc R31,R25
	ldd R2,z+0
	movw R30,R12
	std z+0,R2
	.dbline 199
	movw R24,R30
	adiw R24,1
	movw R12,R24
	.dbline 199
L135:
	.dbline 198
	inc R14
L137:
	.dbline 198
	mov R24,R14
	cpi R24,8
	brlo L134
	.dbline 200
;  
;  
	clr R2
	movw R30,R12
	std z+0,R2
	.dbline 201
;  
	ldi R24,<_ch2
	ldi R25,>_ch2
	std y+1,R25
	std y+0,R24
	ldd R18,y+22
	ldd R16,y+20
	xcall _LCD_DisplayString
	.dbline -2
L113:
	adiw R28,10
	xcall pop_gset5
	adiw R28,4
	.dbline 0 ; func end
	ret
	.dbsym r n 10 c
	.dbsym r j 10 c
	.dbsym r str 12 pc
	.dbsym l a 2 A[8:8]c
	.dbsym r i 14 c
	.dbsym l t 24 l
	.dbsym l y 22 c
	.dbsym l x 20 c
	.dbend
	.area data(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705/lcd.h
_vol16bit::
	.blkb 2
	.area idata
	.word 0
	.area data(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705/lcd.h
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbsym e vol16bit _vol16bit i
_test1::
	.blkb 13
	.area idata
	.byte 32,'A,'D,55,55,48,53,'T,'E,'S,'T,32,0
	.area data(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbsym e test1 _test1 A[13:13]c
_vint::
	.blkb 2
	.area idata
	.word 0
	.area data(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbsym e vint _vint i
_voltemp::
	.blkb 4
	.area idata
	.word 0x0,0x0
	.area data(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbsym e voltemp _voltemp D
_flag::
	.blkb 1
	.area idata
	.byte 0
	.area data(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbsym e flag _flag c
	.area text(rom, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbfunc e main _main fV
;        tongdao -> R20
;       key_vale -> R22
	.even
_main::
	sbiw R28,2
	.dbline -1
	.dbline 43
	.dbline 44
	clr R20
	.dbline 47
	ldi R24,243
	sts 97,R24
	.dbline 48
	ldi R24,255
	sts 98,R24
	.dbline 49
	ldi R24,247
	out 0x11,R24
	.dbline 50
	ldi R24,48
	out 0x35,R24
	.dbline 51
	ldi R24,1
	out 0x39,R24
	.dbline 52
	xcall _LCD_init
	.dbline 53
	ldi R24,<_test1
	ldi R25,>_test1
	std y+1,R25
	std y+0,R24
	ldi R18,1
	ldi R16,1
	xcall _LCD_DisplayString
	xjmp L140
L139:
	.dbline 56
	.dbline 57
	cli
	.dbline 58
	sei
	.dbline 59
	sleep
	.dbline 61
	ldi R24,1
	sts _flag,R24
	tst R24
	brne X3
	xjmp L142
X3:
	.dbline 62
	.dbline 63
	xcall _key_scay
	mov R22,R16
	.dbline 65
	cpi R16,10
	breq X4
	xjmp L144
X4:
	.dbline 66
	.dbline 67
	mov R16,R20
	xcall _ad7705
	sts _vol16bit+1,R17
	sts _vol16bit,R16
	.dbline 68
	ldi R16,<L146
	ldi R17,>L146
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	ldi R16,<L147
	ldi R17,>L147
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	lds R16,_vol16bit
	lds R17,_vol16bit+1
	lsr R17
	ror R16
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall empy32fs
	lds R16,_vol16bit
	lds R17,_vol16bit+1
	andi R16,1
	andi R17,0
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall add32fs
	ldi R16,<L148
	ldi R17,>L148
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall div32fs
	xcall empy32f
	sts _voltemp+1,R17
	sts _voltemp,R16
	sts _voltemp+2+1,R19
	sts _voltemp+2,R18
	.dbline 69
	xcall fp2int
	sts _vint+1,R17
	sts _vint,R16
	.dbline 70
	movw R2,R16
	std y+1,R3
	std y+0,R2
	ldi R18,5
	ldi R16,2
	xcall _LCD_DisplayInt
	.dbline 71
	ldi R16,1
	ldi R17,0
	xcall _delay_nms
	.dbline 72
L144:
	.dbline 73
L142:
	.dbline 74
L140:
	.dbline 55
	xjmp L139
X2:
	.dbline -2
L138:
	adiw R28,2
	.dbline 0 ; func end
	ret
	.dbsym r tongdao 20 c
	.dbsym r key_vale 22 c
	.dbend
	.area vector(rom, abs)
	.org 4
	jmp _int0_isr
	.area text(rom, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
	.dbfunc e int0_isr _int0_isr fV
	.even
_int0_isr::
	st -y,R2
	st -y,R24
	in R2,0x3f
	st -y,R2
	.dbline -1
	.dbline 82
	.dbline 83
	clr R2
	out 0x39,R2
	.dbline 84
	ldi R24,1
	sts _flag,R24
	.dbline 85
	out 0x39,R24
	.dbline -2
L149:
	ld R2,y+
	out 0x3f,R2
	ld R24,y+
	ld R2,y+
	.dbline 0 ; func end
	reti
	.dbend
	.area bss(ram, con, rel)
	.dbfile D:\各种模块设计\模块程序集\ad7705\main.c
_ch2::
	.blkb 8
	.dbfile D:\各种模块设计\模块程序集\ad7705/lcd.h
	.dbsym e ch2 _ch2 A[8:8]c
_ch1::
	.blkb 6
	.dbsym e ch1 _ch1 A[6:6]c
	.area lit(rom, con, rel)
L148:
	.word 0xff00,0x477f
L147:
	.word 0x0,0x4000
L146:
	.word 0x4000,0x451c

⌨️ 快捷键说明

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