📄 12864_example.s
字号:
.module _12864_Example.c
.area text(rom, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_ATMega16L.h
.dbfunc e PORTDefine _PORTDefine fV
.even
_PORTDefine::
.dbline -1
.dbline 76
; /********************************************************
; * 函数库说明:12864LCD显示示例程序 *
; * 版本: v1.0 *
; * 作者: 傻孩子 *
; * 日期: 2006年2月15日 *
; * 修改: 傻孩子 *
; * 修改日期: 2006年2月15日 *
; * *
; * 说明: *
; * 1、提供基本的现实函数。 *
; * 2、支持小组编程规范0.9版的要求。 *
; * 3、对外提供接口,支持位操作。 *
; * 4、注意,这里的X/Y是屏幕竖方时候的坐标轴, *
; * 如果使用字库,要使用转制过后竖向扫描的 *
; * 字库。 *
; * 5、为了兼容串行扫描方式,所以使用宏定义接口 *
; * 的方法。同时也支持非位操作的方式。 *
; ********************************************************/
; # include "RD_ATMega16L.h"
;
; /***********************
; * 系 统 宏 定 义 *
; ***********************/
; # pragma interrupt_handler Timer0OvfIsr:10
; /*---------------------*
; * 常 量 宏 定 义 *
; *---------------------*/
; #ifndef True
; # define True 0x01
; #endif
; #ifndef False
; # define False 0x00
; #endif
; #ifndef High
; # define High 0x01
; #endif
; #ifndef Low
; # define Low 0x00
; #endif
; #ifndef NULL
; # define NULL 0x00
; #endif
; /*---------------------*
; * 动 作 宏 定 义 *
; *---------------------*/
;
; /*---------------------*
; * SerialToCollateral.h *
; * 配置宏定义 *
; *---------------------*/
; # define VSCK _PD4
; # define VRCK _PD3
; # define VSI _PD5
; /*--- 定义_Use_16Bit_VitualPORT 选择两个595模式 ---*/
; # define _Use_16Bit_VitualPORT
;
; # include "SerialToCollateral.h"
;
;
; # define LCD12864_RS PV0
; # define LCD12864_RW PV1
; # define LCD12864_E PV2
; # define LCD12864_CSA PV3
; # define LCD12864_CSB PV4
; # define LCD12864_RST PV5
;
; # define SETBIT_RS LCD12864_RS = High;
; # define CLRBIT_RS LCD12864_RS = Low;
; # define SETBIT_RW LCD12864_RW = High;
; # define CLRBIT_RW LCD12864_RW = Low;
; # define SETBIT_E LCD12864_E = High;refreshVirtualPORT();
; # define CLRBIT_E LCD12864_E = Low;refreshVirtualPORT();
; # define SETBIT_CS1 LCD12864_CSA = High;
; # define CLRBIT_CS1 LCD12864_CSA = Low;
; # define SETBIT_CS2 LCD12864_CSB = High;
; # define CLRBIT_CS2 LCD12864_CSB = Low;
.dbline 77
; # define SETBIT_RST LCD12864_RST = High;refreshVirtualPORT();
ldi R24,59
ldi R25,0
sts _PORTA_BIT+1,R25
sts _PORTA_BIT,R24
.dbline 78
; # define CLRBIT_RST LCD12864_RST = Low;refreshVirtualPORT();
ldi R24,56
sts _PORTB_BIT+1,R25
sts _PORTB_BIT,R24
.dbline 79
;
ldi R24,53
sts _PORTC_BIT+1,R25
sts _PORTC_BIT,R24
.dbline 80
; # define LCD12864_DataTransfer(a) VPORT &= 0x00ff;VPORT |= (a<<8); refreshVirtualPORT();
ldi R24,50
sts _PORTD_BIT+1,R25
sts _PORTD_BIT,R24
.dbline 82
;
; # define ReadDataPORT
ldi R24,58
sts _DDRA_BIT+1,R25
sts _DDRA_BIT,R24
.dbline 83
; # define SetDataPORTDirection_READ
ldi R24,55
sts _DDRB_BIT+1,R25
sts _DDRB_BIT,R24
.dbline 84
; # define SetDataPORTDirection_WRITE
ldi R24,52
sts _DDRC_BIT+1,R25
sts _DDRC_BIT,R24
.dbline 85
;
ldi R24,49
sts _DDRD_BIT+1,R25
sts _DDRD_BIT,R24
.dbline 87
;
; # define _LCD12864_WriteOnly
ldi R24,57
sts _PINA_BIT+1,R25
sts _PINA_BIT,R24
.dbline 88
; # define LCD12864_WaitTime 1
ldi R24,54
sts _PINB_BIT+1,R25
sts _PINB_BIT,R24
.dbline 89
; # include "RD_LCD12864.h"
ldi R24,51
sts _PINC_BIT+1,R25
sts _PINC_BIT,R24
.dbline 90
;
ldi R24,48
sts _PIND_BIT+1,R25
sts _PIND_BIT,R24
.dbline -2
L1:
.dbline 0 ; func end
ret
.dbend
.area vector(rom, abs)
.org 36
jmp _Timer0OvfIsr
.area text(rom, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_ATMega16L.h
.area data(ram, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_ATMega16L.h
_VPORT::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_ATMega16L.h
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/SerialToCollateral.h
.dbsym e VPORT _VPORT i
_VPORTBit::
.blkw 1
.area idata
.word _VPORT
.area data(ram, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/SerialToCollateral.h
.dbstruct 0 2 VirtualPORT
.dbfield 0 BIT0 F[0:1]
.dbfield 0 BIT1 F[1:1]
.dbfield 0 BIT2 F[2:1]
.dbfield 0 BIT3 F[3:1]
.dbfield 0 BIT4 F[4:1]
.dbfield 0 BIT5 F[5:1]
.dbfield 0 BIT6 F[6:1]
.dbfield 0 BIT7 F[7:1]
.dbfield 0 BIT8 F[8:1]
.dbfield 0 BIT9 F[9:1]
.dbfield 0 BIT10 F[10:1]
.dbfield 0 BIT11 F[11:1]
.dbfield 0 BIT12 F[12:1]
.dbfield 0 BIT13 F[13:1]
.dbfield 0 BIT14 F[14:1]
.dbfield 0 BIT15 F[15:1]
.dbend
.dbsym e VPORTBit _VPORTBit pS[VirtualPORT]
_IfPortChange::
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/SerialToCollateral.h
.dbsym e IfPortChange _IfPortChange c
.area text(rom, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/SerialToCollateral.h
.dbfunc e setBIT _setBIT fc
; BIT -> R20
.even
_setBIT::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 155
;
; /***********************
; * 全局变量声明区 *
; ***********************/
; unsigned int FlashGIFStringCounter = 0;
; unsigned int FlashTimeCounter = 0;
;
; flash char LOGO[1024] = {
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xC0,0xC0,0xE0,0xE0,0x60,
; 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,
; 0xF8,0xF8,0xC0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
; 0x40,0xE0,0xF0,0xB0,0xA0,0xA0,0xE0,0x40,0x00,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xC0,0x00,0x00,0x00,0xF0,0xF0,0x80,0x80,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xE0,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xE0,0x90,
; 0xB8,0xF0,0xE0,0xB8,0x98,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x78,0xF0,0x10,0xF8,0xFC,0x8C,0xC8,0xFF,0x8F,
; 0x86,0xFC,0xFC,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x11,0x5B,0xFF,
; 0xFF,0xFF,0xFE,0xA6,0x04,0x04,0xFC,0xF8,0x08,0x00,0x00,0x00,0x00,0x04,0x0E,0x6E,
; 0x7E,0xFF,0xFF,0x1D,0x2F,0x27,0x37,0x1A,0x0C,0xFF,0xFF,0x02,0x02,0x00,0x00,0x00,
; 0x00,0x00,0x08,0x9C,0xDC,0xFE,0x7F,0x3B,0x2C,0x66,0xEE,0xDF,0xFB,0xB1,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0xF8,0xFC,0x7F,0x1F,0x4F,0xC7,
; 0x83,0x83,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x1E,0x07,0x81,0x81,0xD9,
; 0xFD,0xFC,0xFC,0xEE,0x43,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,
; 0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x01,
; 0x07,0x07,0x02,0x02,0x06,0x06,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0F,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x01,0x01,0x03,0x07,0x01,0x01,0x03,0x01,0x01,0x01,0x03,0x03,0x07,
; 0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x01,0x00,0x00,0x00,0x00,
; 0x01,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,
; 0x08,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x78,0x88,
; 0x8E,0x0F,0x01,0x81,0x8E,0x8E,0xFA,0x72,0x02,0xE2,0xE2,0x02,0x02,0xFE,0xFC,0x00,
; 0x00,0x00,0x00,0xFE,0xFF,0x81,0x81,0x91,0x81,0xC1,0x7F,0x7F,0x41,0x41,0x41,0x91,
; 0x81,0x81,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFE,0x03,0x01,
; 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x70,0x10,0x10,
; 0x10,0xFE,0xFF,0x01,0x01,0x3F,0x3E,0x10,0x10,0x70,0xE0,0x00,0x00,0xC0,0xF0,0x3C,
; 0x0E,0x03,0x01,0x11,0x1C,0x1E,0xE2,0x02,0x02,0x22,0x22,0x02,0x02,0x02,0xFE,0xFC,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x3E,0x23,
; 0xE1,0xE0,0x00,0x00,0xF8,0xF9,0x0F,0x06,0x00,0xFF,0xFF,0x00,0x08,0x0F,0x0F,0xF8,
; 0x00,0x00,0x00,0xCC,0xC4,0x00,0x00,0x00,0x00,0x04,0xFC,0xFC,0x0D,0x01,0x02,0x03,
; 0x00,0x00,0xC4,0xC8,0x00,0x00,0xC0,0xE0,0x30,0x18,0x0C,0x06,0x03,0x00,0x00,0x30,
; 0x78,0xC0,0x80,0x00,0x00,0x00,0x10,0x20,0x00,0x00,0x18,0x3E,0x63,0x40,0xC0,0xE0,
; 0x38,0x3F,0x3F,0x00,0x00,0xFC,0xFC,0x40,0x80,0x80,0xC3,0x7E,0x30,0xD8,0xFD,0x27,
; 0x20,0x20,0x20,0xE0,0x72,0x3F,0x0C,0x00,0x00,0x22,0x22,0x00,0x00,0x00,0x3F,0xFF,
; 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,
; 0x05,0x07,0x06,0x06,0x07,0x07,0x06,0x06,0x04,0x05,0x07,0x06,0x06,0x06,0x07,0x05,
; 0x04,0x04,0x04,0x05,0x07,0x06,0x06,0x06,0x06,0x06,0x07,0x07,0x06,0x06,0x06,0x06,
; 0x06,0x06,0x07,0x05,0x04,0x04,0x04,0x07,0x06,0x06,0x06,0x06,0x05,0x04,0x04,0x04,
; 0x04,0x04,0x05,0x05,0x06,0x06,0x06,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x07,
; 0x06,0x06,0x06,0x06,0x06,0x07,0x05,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x07,0x06,
; 0x06,0x06,0x07,0x07,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x07,
; 0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x78,0x48,0xC8,0x98,0xB8,0x38,0x00,0x08,
; 0xF8,0xF8,0xC8,0xC8,0xF8,0xF8,0x08,0x08,0xF8,0xF8,0x08,0x08,0xF8,0xF8,0x08,0x00,
; 0x30,0x78,0x48,0xC8,0x98,0xB8,0x38,0x00,0x18,0x18,0x08,0xF8,0xF8,0x08,0x18,0x18,
; 0x00,0x00,0x00,0x00,0x00,0x08,0xF8,0xF8,0x88,0x88,0xF8,0x70,0x00,0x00,0xF0,0xF8,
; 0x08,0x08,0x08,0xF8,0xF0,0x00,0x08,0xF8,0xF8,0x48,0x48,0xF8,0xB0,0x00,0x00,0xF0,
; 0xF8,0x08,0x08,0x08,0xF8,0xF0,0x00,0x18,0x18,0x08,0xF8,0xF8,0x08,0x18,0x18,0x08,
; 0xF8,0xF8,0x48,0xE8,0xF8,0x18,0x00,0x00,0x00,0xC8,0xF8,0xF8,0xC0,0x00,0x00,0x08,
; 0xF8,0xF8,0xF0,0xF0,0xF8,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
; 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x06,0x04,0x04,0x07,0x03,0x00,0x00,
.dbline 156
; 0x01,0x07,0x07,0x07,0x07,0x01,0x00,0x00,0x03,0x07,0x04,0x04,0x07,0x03,0x00,0x00,
cpi R20,16
brlo L3
.dbline 157
; 0x07,0x07,0x06,0x04,0x04,0x07,0x03,0x00,0x00,0x00,0x04,0x07,0x07,0x04,0x00,0x00,
.dbline 158
; 0x00,0x00,0x00,0x00,0x00,0x04,0x07,0x07,0x00,0x04,0x07,0x07,0x04,0x00,0x03,0x07,
clr R16
xjmp L2
L3:
.dbline 161
; 0x04,0x04,0x04,0x07,0x03,0x00,0x04,0x07,0x07,0x04,0x04,0x07,0x03,0x00,0x00,0x03,
; 0x07,0x04,0x04,0x04,0x07,0x03,0x00,0x00,0x00,0x04,0x07,0x07,0x04,0x00,0x00,0x04,
; 0x07,0x07,0x04,0x04,0x06,0x06,0x00,0x04,0x07,0x07,0x05,0x05,0x07,0x07,0x04,0x04,
mov R18,R20
clr R19
ldi R16,1
ldi R17,0
xcall lsl16
lds R2,_VPORT
lds R3,_VPORT+1
or R2,R16
or R3,R17
sts _VPORT+1,R3
sts _VPORT,R2
.dbline 162
; 0x07,0x07,0x04,0x04,0x07,0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
ldi R24,1
sts _IfPortChange,R24
.dbline 163
; };
xcall _VirtualPORTProccess
.dbline 164
;
ldi R16,1
.dbline -2
L2:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r BIT 20 c
.dbend
.dbfunc e clearBIT _clearBIT fc
; BIT -> R20
.even
_clearBIT::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 173
;
; /***********************
; * 系统函数声明区 *
; ***********************/
; void SystemInit(void);
; void PortInit(void);
; void Timer0Init(void);
;
; /********************************************************
.dbline 174
; * 函数说明:端口初始化 *
cpi R20,16
brlo L6
.dbline 175
; ********************************************************/
.dbline 176
; void PortInit(void)
clr R16
xjmp L5
L6:
.dbline 179
; {
; DDRD = 0xff;
; PORTD = 0xff;
mov R18,R20
clr R19
ldi R16,1
ldi R17,0
xcall lsl16
movw R2,R16
com R2
com R3
lds R4,_VPORT
lds R5,_VPORT+1
and R4,R2
and R5,R3
sts _VPORT+1,R5
sts _VPORT,R4
.dbline 180
;
ldi R24,1
sts _IfPortChange,R24
.dbline 181
; DDRA = 0xff;
xcall _VirtualPORTProccess
.dbline 182
; PORTA = 0xff;
ldi R16,1
.dbline -2
L5:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r BIT 20 c
.dbend
.dbfunc e VirtualPORTProccess _VirtualPORTProccess fV
.even
_VirtualPORTProccess::
.dbline -1
.dbline 189
.dbline 190
lds R2,_IfPortChange
tst R2
breq L9
.dbline 191
.dbline 192
xcall _refreshVirtualPORT
.dbline 193
clr R2
sts _IfPortChange,R2
.dbline 194
L9:
.dbline -2
L8:
.dbline 0 ; func end
ret
.dbend
.dbfunc e refreshVirtualPORT _refreshVirtualPORT fV
; TempData -> R20
; n -> R22
.even
_refreshVirtualPORT::
xcall push_gset2
.dbline -1
.dbline 201
;
; DDRC = 0xff;
; PORTC = 0xff;
;
; PORTDefine();
; }
;
; /********************************************************
; * 函数说明:定时器0初始化函数 *
; ********************************************************/
; void Timer0Init(void)
; {
; TCCR0 = 0x00; //stop
; TCNT0 = 0x83; //set count
; TCCR0 = 0x03; //start timer
; }
;
; /********************************************************
; * 函数说明:定时器0中断处理函数 *
.dbline 202
; ********************************************************/
clr R22
.dbline 203
; void Timer0OvfIsr(void)
clr R20
.dbline 205
; {
; TCNT0 = 0x83;
lds R30,_PORTD_BIT
lds R31,_PORTD_BIT+1
ldd R24,z+0
andi R24,247
std z+0,R24
.dbline 206
;
xjmp L15
L12:
.dbline 207
.dbline 208
mov R18,R22
clr R19
lsl R18
rol R19
lsl R18
rol R19
lsl R18
rol R19
lds R16,_VPORT
lds R17,_VPORT+1
xcall lsl16
movw R20,R16
mov R20,R21
clr R21
.dbline 209
mov R16,R20
xcall _sendBITS
.dbline 210
L13:
.dbline 206
inc R22
L15:
.dbline 206
cpi R22,2
brlo L12
.dbline 211
; FlashGIFStringCounter ++;
; FlashTimeCounter ++;
;
; }
;
lds R30,_PORTD_BIT
lds R31,_PORTD_BIT+1
ldd R24,z+0
ori R24,8
std z+0,R24
.dbline 212
; /********************************************************
clr R2
sts _IfPortChange,R2
.dbline -2
L11:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r TempData 20 c
.dbsym r n 22 c
.dbend
.dbfunc e sendBITS _sendBITS fV
; n -> R20
; Data -> R22
.even
_sendBITS::
xcall push_gset2
mov R22,R16
.dbline -1
.dbline 220
; * 函数说明:系统初始化函数 *
; ********************************************************/
; void SystemInit(void)
; {
; CLI();
;
; PortInit();
; Timer0Init();
.dbline 221
;
clr R20
.dbline 222
; LCD12864Init();
xjmp L20
L17:
.dbline 223
;
.dbline 224
; TIMSK = 0x01
lds R30,_PORTD_BIT
lds R31,_PORTD_BIT+1
ldd R24,z+0
andi R24,239
std z+0,R24
.dbline 225
;
mov R16,R22
mov R17,R20
xcall lsl8
mov R24,R16
andi R24,128
brne L21
.dbline 226
; SEI();
.dbline 227
; }
lds R30,_PORTD_BIT
lds R31,_PORTD_BIT+1
ldd R24,z+0
andi R24,223
std z+0,R24
.dbline 228
;
xjmp L22
L21:
.dbline 230
;
;
.dbline 231
; void main(void)
lds R30,_PORTD_BIT
lds R31,_PORTD_BIT+1
ldd R24,z+0
ori R24,32
std z+0,R24
.dbline 232
; {
L22:
.dbline 233
lds R30,_PORTD_BIT
lds R31,_PORTD_BIT+1
ldd R24,z+0
ori R24,16
std z+0,R24
.dbline 235
L18:
.dbline 222
inc R20
L20:
.dbline 222
cpi R20,8
brsh X0
xjmp L17
X0:
.dbline -2
L16:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r n 20 c
.dbsym r Data 22 c
.dbend
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_LCD12864.h
.dbfunc e waitForLCDReady _waitForLCDReady fV
; a -> R16
.even
_waitForLCDReady::
.dbline -1
.dbline 96
.dbline 107
clr R16
.dbline 108
xjmp L27
L24:
.dbline 109
.dbline 110
nop
.dbline 111
L25:
.dbline 108
inc R16
L27:
.dbline 108
cpi R16,1
brlo L24
.dbline -2
L23:
.dbline 0 ; func end
ret
.dbsym r a 16 c
.dbend
.dbfunc e sendDataToLCD _sendDataToLCD fV
; Data -> R20
.even
_sendDataToLCD::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 121
.dbline 122
xcall _waitForLCDReady
.dbline 125
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,1
std z+0,R24
.dbline 125
.dbline 125
.dbline 126
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,253
std z+0,R24
.dbline 126
.dbline 126
.dbline 126
.dbline 129
lds R24,_VPORT
lds R25,_VPORT+1
andi R25,0
sts _VPORT+1,R25
sts _VPORT,R24
.dbline 129
mov R2,R20
clr R3
mov R3,R2
clr R2
movw R4,R24
or R4,R2
or R5,R3
sts _VPORT+1,R5
sts _VPORT,R4
.dbline 129
xcall _refreshVirtualPORT
.dbline 129
.dbline 132
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,4
std z+0,R24
.dbline 132
xcall _refreshVirtualPORT
.dbline 132
.dbline 132
.dbline 133
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,251
std z+0,R24
.dbline 133
xcall _refreshVirtualPORT
.dbline 133
.dbline 133
.dbline -2
L28:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r Data 20 c
.dbend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -