📄 12864.s
字号:
; /*******************************************************/
; /****** 函数名称: LCD_write_string() ******/
; /****** 功 能: 中英文字符串显示函数 ******/
; /****** 参 数: *s--英文字符串指针 ******/
; /****** X、Y--显示字符串的位置 ******/
; /****** 返回值 : 无 ******/
; /*******************************************************/
; void LCD_Write_string(unsigned char X,unsigned char Y,unsigned char *s)
; {
.dbline 138
;
; LCD_address( X, Y ); //写显示地址
mov R18,R10
mov R16,R22
xcall _LCD_address
xjmp L47
L46:
.dbline 140
.dbline 141
movw R30,R20
ldd R16,z+0
xcall _WR_dat
.dbline 142
subi R20,255 ; offset = 1
sbci R21,255
.dbline 143
L47:
.dbline 139
; while (*s) //是否到字符串尾
movw R30,R20
ldd R2,z+0
tst R2
brne L46
.dbline -2
L45:
xcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r s 20 pc
.dbsym r Y 10 c
.dbsym r X 22 c
.dbend
.dbfunc e BCD_ASCII _BCD_ASCII fc
; bcd -> R16
.even
_BCD_ASCII::
.dbline -1
.dbline 155
; {
; WR_dat (*s ); //写显示数据
; s ++; //字符串地址加1
; }
; }
;
;
; /******************************************************************************/
; //函数功能:将BCD码转换为ASCII码函数
; //输入数据:BCD
; //输出:ASCII
; //详见SCII码表
; /******************************************************************************/
;
; unsigned char BCD_ASCII(unsigned char bcd)
; {
.dbline 156
; bcd &= 0x0F;
andi R16,15
.dbline 157
; if(bcd > 9)
ldi R24,9
cp R24,R16
brsh L50
.dbline 158
; bcd +=('7'); // 将A~F转换为ASCII
subi R16,201 ; addi 55
xjmp L51
L50:
.dbline 160
; else
; bcd += '0'; // 将0~9转换为ASCII 0~9
subi R16,208 ; addi 48
L51:
.dbline 161
; return(bcd);
.dbline -2
L49:
.dbline 0 ; func end
ret
.dbsym r bcd 16 c
.dbend
.dbfunc e LCD_writeasc _LCD_writeasc fV
; data -> y+4
; y -> R22
; x -> R20
.even
_LCD_writeasc::
xcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 171
; }
; /*******************************************************/
; /****** 函数名称: LCD_writeasc ******/
; /****** 功 能: 输入ASCII码显示对应的字符 ******/
; /****** 参 数: 无 ******/
; /****** 返回值 : 无 ******/
; /*******************************************************/
;
; void LCD_writeasc(unsigned char x, unsigned char y, unsigned char data)
; {
.dbline 172
; LCD_address(x,y);
mov R18,R22
mov R16,R20
xcall _LCD_address
.dbline 173
; WR_dat(data);
ldd R16,y+4
xcall _WR_dat
.dbline -2
L52:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym l data 4 c
.dbsym r y 22 c
.dbsym r x 20 c
.dbend
.dbfunc e Lcd_INT _Lcd_INT fV
.even
_Lcd_INT::
.dbline -1
.dbline 182
; }
; /*******************************************************/
; /****** 函数名称: Lcd_INT() ******/
; /****** 功 能: LCD初始化 ******/
; /****** 参 数: 无 ******/
; /****** 返回值 : 无 ******/
; /*******************************************************/
; void Lcd_INT()
; {
.dbline 183
; DDRA|=BIT(1);
sbi 0x1a,1
.dbline 184
; DDRA|=BIT(3);
sbi 0x1a,3
.dbline 185
; lcd_control();
xcall _lcd_control
.dbline 186
; lcd_clear();
xcall _lcd_clear
.dbline -2
L53:
.dbline 0 ; func end
ret
.dbend
.dbfunc e lcd_writechar _lcd_writechar fV
; number -> y+4
; Y -> R22
; X -> R20
.even
_lcd_writechar::
xcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 195
; }
; /*******************************************************/
; /****** 函数名称: lcd_writechar ******/
; /****** 功 能: 输入10进制数转化为16进制数 ******/
; /****** 参 数: 无 ******/
; /****** 返回值 : 无 ******/
; /*******************************************************/
; void lcd_writechar(unsigned char X,unsigned char Y,unsigned char number)
; {
.dbline 196
; LCD_address(X,Y);
mov R18,R22
mov R16,R20
xcall _LCD_address
.dbline 197
; WR_dat(BCD_ASCII(number>>4));
ldd R16,y+4
swap R16
andi R16,#0x0F
xcall _BCD_ASCII
xcall _WR_dat
.dbline 198
; WR_dat(BCD_ASCII(number));
ldd R16,y+4
xcall _BCD_ASCII
xcall _WR_dat
.dbline -2
L54:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym l number 4 c
.dbsym r Y 22 c
.dbsym r X 20 c
.dbend
.dbfunc e lcd_write2 _lcd_write2 fV
; number -> y+4
; Y -> R22
; X -> R20
.even
_lcd_write2::
xcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 202
; }
;
; void lcd_write2(unsigned char X,unsigned char Y,unsigned char number)
; {
.dbline 203
; LCD_address(X,Y);
mov R18,R22
mov R16,R20
xcall _LCD_address
.dbline 205
;
; WR_dat(BCD_ASCII(number%100/10));
ldi R17,100
ldd R16,y+4
xcall mod8u
ldi R17,10
xcall div8u
xcall _BCD_ASCII
xcall _WR_dat
.dbline 206
; WR_dat(BCD_ASCII(number%10));
ldi R17,10
ldd R16,y+4
xcall mod8u
xcall _BCD_ASCII
xcall _WR_dat
.dbline -2
L55:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym l number 4 c
.dbsym r Y 22 c
.dbsym r X 20 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -