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

📄 ad.s

📁 基于ATMEGA16的AD转换的C程序源代码
💻 S
📖 第 1 页 / 共 3 页
字号:
;     
;  	LCD_address( X, Y );		   				//写显示地址
	mov R18,R12
	mov R16,R10
	xcall _LCD_address
	xjmp L43
L42:
	.dbline 116
;     while (*s) 	   	 						//是否到字符串尾
;     {
	.dbline 117
;      	WR_dat (*s );						//写显示数据
	movw R30,R20
	ldd R16,z+0
	xcall _WR_dat
	.dbline 118
; 		s ++;								//字符串地址加1
	subi R20,255  ; offset = 1
	sbci R21,255
	.dbline 119
;  	}
L43:
	.dbline 115
	movw R30,R20
	ldd R2,z+0
	tst R2
	brne L42
X11:
	.dbline -2
L41:
	.dbline 0 ; func end
	xjmp pop_xgset303C
	.dbsym r s 20 pc
	.dbsym r Y 12 c
	.dbsym r X 10 c
	.dbend
	.dbfunc e BCD_ASCII _BCD_ASCII fc
;            bcd -> R16
	.even
_BCD_ASCII::
	.dbline -1
	.dbline 131
; }
; 
; 
; /******************************************************************************/ 
; //函数功能:将BCD码转换为ASCII码函数 
; //输入数据:BCD
; //输出:ASCII
; //作者:韩红瑞
; //修改时间:2006-08-31
; /******************************************************************************/ 
; unsigned char BCD_ASCII(unsigned char bcd) 
; { 
	.dbline 132
;     bcd &= 0x0F; 
	andi R16,15
	.dbline 133
;     if(bcd > 9)  
	ldi R24,9
	cp R24,R16
	brsh L46
X12:
	.dbline 134
;     bcd +=('7');     // 将A~F转换为ASCII 
	subi R16,201    ; addi 55
	xjmp L47
L46:
	.dbline 136
;     else 
;     bcd += '0';         // 将0~9转换为ASCII 0~9 
	subi R16,208    ; addi 48
L47:
	.dbline 137
;     return(bcd); 
	.dbline -2
L45:
	.dbline 0 ; func end
	ret
	.dbsym r bcd 16 c
	.dbend
	.dbfunc e LCD_writeasc _LCD_writeasc fV
;           data -> y+4
;              y -> R12
;              x -> R10
	.even
_LCD_writeasc::
	xcall push_xgset003C
	mov R12,R18
	mov R10,R16
	.dbline -1
	.dbline 142
; } 
;  
; 
; void  LCD_writeasc(unsigned char x, unsigned char y, unsigned char data)
; {
	.dbline 143
;     LCD_address(x,y);
	mov R18,R12
	mov R16,R10
	xcall _LCD_address
	.dbline 144
; 	WR_dat(data);
	ldd R16,y+4
	xcall _WR_dat
	.dbline -2
L48:
	.dbline 0 ; func end
	xjmp pop_xgset003C
	.dbsym l data 4 c
	.dbsym r y 12 c
	.dbsym r x 10 c
	.dbend
	.dbfunc e Lcd_INT _Lcd_INT fV
	.even
_Lcd_INT::
	.dbline -1
	.dbline 148
; }
;   
; void Lcd_INT()
; {
	.dbline 149
;   DDRA|=BIT(1);
	sbi 0x1a,1
	.dbline 150
;   DDRA|=BIT(3);
	sbi 0x1a,3
	.dbline 151
;   lcd_control();
	xcall _lcd_control
	.dbline -2
L49:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e lcd_writechar _lcd_writechar fV
;         number -> R10
;              Y -> R14
;              X -> R12
	.even
_lcd_writechar::
	xcall push_xgset00FC
	mov R14,R18
	mov R12,R16
	ldd R10,y+6
	.dbline -1
	.dbline 155
; }
; 
; void lcd_writechar(unsigned char X,unsigned char Y,unsigned char number)
; {
	.dbline 156
;     LCD_address(X,Y);
	mov R18,R14
	mov R16,R12
	xcall _LCD_address
	.dbline 157
; 	WR_dat(BCD_ASCII(number>>4));
	mov R16,R10
	swap R16
	andi R16,#0x0F
	xcall _BCD_ASCII
	xcall _WR_dat
	.dbline 158
; 	WR_dat(BCD_ASCII(number));
	mov R16,R10
	xcall _BCD_ASCII
	xcall _WR_dat
	.dbline -2
L50:
	.dbline 0 ; func end
	xjmp pop_xgset00FC
	.dbsym r number 10 c
	.dbsym r Y 14 c
	.dbsym r X 12 c
	.dbend
	.dbfunc e lcd_write2 _lcd_write2 fV
;         number -> R10,R11
;              Y -> R14
;              X -> R12
	.even
_lcd_write2::
	xcall push_xgset00FC
	mov R14,R18
	mov R12,R16
	ldd R10,y+6
	ldd R11,y+7
	.dbline -1
	.dbline 162
; }
; 
; void lcd_write2(unsigned char X,unsigned char Y,unsigned int number)
; {
	.dbline 163
;     LCD_address(X,Y);
	mov R18,R14
	mov R16,R12
	xcall _LCD_address
	.dbline 164
; 	WR_dat(a[(number/1000)]);
	ldi R18,1000
	ldi R19,3
	movw R16,R10
	xcall div16u
	movw R30,R16
	ldi R24,<_a
	ldi R25,>_a
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _WR_dat
	.dbline 165
; 	WR_dat(a[(number%1000/100)]);
	ldi R18,1000
	ldi R19,3
	movw R16,R10
	xcall mod16u
	ldi R18,100
	ldi R19,0
	xcall div16u
	movw R30,R16
	ldi R24,<_a
	ldi R25,>_a
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _WR_dat
	.dbline 166
; 	WR_dat(a[(number%100/10)]);
	ldi R18,100
	ldi R19,0
	movw R16,R10
	xcall mod16u
	ldi R18,10
	ldi R19,0
	xcall div16u
	movw R30,R16
	ldi R24,<_a
	ldi R25,>_a
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _WR_dat
	.dbline 167
; 	WR_dat(a[(number%10)]);
	ldi R18,10
	ldi R19,0
	movw R16,R10
	xcall mod16u
	movw R30,R16
	ldi R24,<_a
	ldi R25,>_a
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _WR_dat
	.dbline -2
L51:
	.dbline 0 ; func end
	xjmp pop_xgset00FC
	.dbsym r number 10 i
	.dbsym r Y 14 c
	.dbsym r X 12 c
	.dbend
	.area lit(rom, con, rel)
_Bitmap::
	.byte 0,0
	.byte 0,0
	.byte 0,128
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,130
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 1,6
	.byte 12,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 2,4
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,4
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,4
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,4
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,4
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,15
	.byte 254,4
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,16
	.byte 1,255
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 136,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 63,252
	.byte 0,0
	.byte 200,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,0
	.byte 0,0
	.byte 40,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,0
	.byte 0,0
	.byte 24,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 4,0
	.byte 0,0
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 2,0
	.byte 0,0
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 1,0
	.byte 0,0
	.byte 8,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 1,0
	.byte 0,0
	.byte 12,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 1,0
	.byte 0,0
	.byte 4,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 255,240
	.byte 0,0
	.byte 4,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 6,0
	.byte 4,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 8,0
	.byte 4,0
	.byte 0,0
	.byte 0,28
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 127,240
	.byte 9,224
	.byte 4,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 96,0
	.byte 8,32
	.byte 4,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 64,0
	.byte 8,32
	.byte 4,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 192,0
	.byte 15,224
	.byte 4,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 4,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 12,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 16,0
	.byte 0,0
	.byte 0,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 'p,0
	.byte 0,0
	.byte 0,8
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,1
	.byte 192,0
	.byte 0,0
	.byte 0,8
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 255,254
	.byte 0,0
	.byte 0,0
	.byte 0,16
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,15
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,16
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,63
	.byte 255,255
	.byte 224,0
	.byte 0,0
	.byte 0,32
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 16,0
	.byte 0,0
	.byte 0,32
	.byte 15,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 15,128
	.byte 0,0
	.byte 0,64
	.byte 1,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 0,127
	.byte 255,252
	.byte 0,64
	.byte 1,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,128
	.byte 1,0
	.byte 0,0
	.byte 0,0
	.byte 128,0
	.byte 0,0
	.byte 0,0
	.byte 3,224
	.byte 0,128
	.byte 1,0
	.byte 0,0
	.byte 0,0
	.byte 192,0
	.byte 0,0
	.byte 0,0
	.byte 6,32
	.byte 1,0
	.byte 1,0
	.byte 0,0
	.byte 0,0
	.byte 224,0
	.byte 0,0
	.byte 0,0
	.byte 0,32
	.byte 3,0
	.byte 1,0

⌨️ 快捷键说明

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