📄 t6963.s
字号:
.byte 24,12
.byte 6,12
.byte 24,24
.byte 24,48
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 'q,219
.byte 142,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 28,28
.byte 0,0
.byte 0,0
.dbfile D:\NEW\AVR_T6963/dot.h
.dbsym e ASC_MSK _ASC_MSK A[1536:1536]kc
_GB_16::
.byte 214,208
.byte 1,0
.byte 1,0
.byte 33,8
.byte 63,252
.byte 33,8
.byte 33,8
.byte 33,8
.byte 33,8
.byte 33,8
.byte 63,248
.byte 33,8
.byte 1,0
.byte 1,0
.byte 1,0
.byte 1,0
.byte 1,0
.byte 206,196
.byte 2,0
.byte 1,0
.byte 1,0
.byte 255,254
.byte 8,32
.byte 8,32
.byte 8,32
.byte 4,64
.byte 4,64
.byte 2,128
.byte 1,0
.byte 2,128
.byte 4,96
.byte 24,30
.byte 224,8
.byte 0,0
.byte 178,226
.byte 64,2
.byte 39,194
.byte 36,'B
.byte 132,'R
.byte 'E,'R
.byte 'U,'R
.byte 21,'R
.byte 37,'R
.byte 37,'R
.byte 37,'R
.byte 197,'R
.byte 'A,2
.byte 'B,130
.byte 'B,'B
.byte 'D,'J
.byte 'H,4
.byte 202,212
.byte 0,32
.byte 64,40
.byte 32,36
.byte 48,36
.byte 39,254
.byte 0,32
.byte 224,32
.byte 39,224
.byte 33,32
.byte 33,16
.byte 33,16
.byte 33,10
.byte 41,202
.byte 54,6
.byte 32,2
.byte 0,0
.dbstruct 0 34 .1
.dbfield 0 Index A[2:2]c
.dbfield 2 Msk A[32:32]c
.dbend
.dbsym e GB_16 _GB_16 A[136:4]kS[.1]
_uPowArr::
.byte 1,2
.byte 4,8
.byte 16,32
.byte 64,128
.dbfile D:\NEW\AVR_T6963/t6963.h
.dbsym e uPowArr _uPowArr A[8:8]kc
_turnf::
.byte 7,6
.byte 5,4
.byte 3,2
.byte 1,0
.dbsym e turnf _turnf A[8:8]kc
.area text(rom, con, rel)
.dbfile D:\NEW\AVR_T6963/t6963.h
.dbfile D:\NEW\AVR_T6963\t6963.c
.dbfunc e fnGetRow _fnGetRow fc
.even
_fnGetRow::
.dbline -1
.dbline 9
; #define T6963_C
; #include "includes.h"
;
;
; /************************************************/
; /* 取当前行数据*/
; /************************************************/
; unsigned char fnGetRow(void)
; {
.dbline 10
; return(gCurRow);
lds R16,_gCurRow
.dbline -2
L2:
.dbline 0 ; func end
ret
.dbend
.dbfunc e fnGetCol _fnGetCol fc
.even
_fnGetCol::
.dbline -1
.dbline 16
; }
; /************************************************/
; /* 取当前列数据*/
; /************************************************/
; unsigned char fnGetCol(void)
; {
.dbline 17
; return(gCurCol);
lds R16,_gCurCol
.dbline -2
L3:
.dbline 0 ; func end
ret
.dbend
.dbfunc e RD_LCM _RD_LCM fc
; temp -> R16
.even
_RD_LCM::
.dbline -1
.dbline 23
; }
; /************************************************/
; /* 读状态*/
; /************************************************/
; unsigned char RD_LCM(void)
; {
.dbline 25
; unsigned char temp;
; dir_datap=0x00;
clr R2
out 0x17,R2
.dbline 26
; port_conp |= (1 <<LCM ); //LCM=LCMCW;
sbi 0x1b,2
.dbline 27
; port_conp &= ~(1 << RD); //RD=0;
cbi 0x1b,1
.dbline 28
; NOP();
nop
.dbline 29
; temp=LCD_IN;
in R16,0x16
.dbline 30
; port_conp |= (1<<RD); //RD=1;
sbi 0x1b,1
.dbline 31
; dir_datap = 0xff;
ldi R24,255
out 0x17,R24
.dbline 32
; return(temp);
.dbline -2
L4:
.dbline 0 ; func end
ret
.dbsym r temp 16 c
.dbend
.dbfunc e RD_DAT _RD_DAT fc
; temp -> R16
.even
_RD_DAT::
.dbline -1
.dbline 38
; }
; /************************************************/
; /* 读数据*/
; /************************************************/
; unsigned char RD_DAT(void)
; {
.dbline 40
; unsigned char temp;
; dir_datap = 0x00;
clr R2
out 0x17,R2
.dbline 41
; port_conp &= ~(1<<LCM); //LCM=LCMDW;
cbi 0x1b,2
.dbline 42
; port_conp &= ~(1 << RD); //RD=0;
cbi 0x1b,1
.dbline 43
; NOP();
nop
.dbline 44
; temp = LCD_IN;
in R16,0x16
.dbline 45
; port_conp |= (1<<RD); //RD=1;
sbi 0x1b,1
.dbline 46
; dir_datap = 0xff;
ldi R24,255
out 0x17,R24
.dbline 47
; return(temp);
.dbline -2
L5:
.dbline 0 ; func end
ret
.dbsym r temp 16 c
.dbend
.dbfunc e WR_DAT _WR_DAT fV
; val -> R16
.even
_WR_DAT::
.dbline -1
.dbline 53
; }
; /************************************************/
; /* 写数据*/
; /************************************************/
; void WR_DAT(unsigned char val)
; {
.dbline 54
; dir_datap = 0xff;
ldi R24,255
out 0x17,R24
.dbline 55
; port_conp &= ~(1<<LCM); //LCM=LCMDW;
cbi 0x1b,2
.dbline 56
; LCD_OUT = val;
out 0x18,R16
.dbline 57
; port_conp &= ~(1<<WR); //WR=0;
cbi 0x1b,0
.dbline 58
; NOP();
nop
.dbline 59
; NOP();
nop
.dbline 60
; port_conp |= (1<<WR); //WR=1;
sbi 0x1b,0
.dbline -2
.dbline 61
; }
L6:
.dbline 0 ; func end
ret
.dbsym r val 16 c
.dbend
.dbfunc e WR_CMD _WR_CMD fV
; val -> R16
.even
_WR_CMD::
.dbline -1
.dbline 66
; /************************************************/
; /* 写命令*/
; /************************************************/
; void WR_CMD(unsigned char val)
; {
.dbline 67
; dir_datap = 0xff;
ldi R24,255
out 0x17,R24
.dbline 68
; port_conp |= (1 << LCM); //LCM=LCMCW;
sbi 0x1b,2
.dbline 69
; LCD_OUT = val;
out 0x18,R16
.dbline 70
; port_conp &= ~(1<<WR); //WR=0;
cbi 0x1b,0
.dbline 71
; NOP();
nop
.dbline 72
; NOP();
nop
.dbline 73
; port_conp |= (1<<WR); //WR=1;
sbi 0x1b,0
.dbline -2
.dbline 74
; }
L7:
.dbline 0 ; func end
ret
.dbsym r val 16 c
.dbend
.dbfunc e fnSTA01 _fnSTA01 fc
; i -> R20
.even
_fnSTA01::
xcall push_gset1
.dbline -1
.dbline 80
; /************************************************/
; /* 状态位STA1,STA0判断读写指令和读写数据*/
; /* 在读写数据或者写入命令前必须保证均为1 */
; /************************************************/
; unsigned char fnSTA01(void)
; {
.dbline 82
; unsigned char i;
; for(i=10;i>0;i--)
ldi R20,10
xjmp L12
L9:
.dbline 83
; {
.dbline 84
; if((RD_LCM() & 0x03) == 0x03) // 读取状态
xcall _RD_LCM
mov R24,R16
andi R24,3
cpi R24,3
brne L13
.dbline 85
; {
.dbline 86
; break;
xjmp L11
L13:
.dbline 88
L10:
.dbline 82
dec R20
L12:
.dbline 82
clr R2
cp R2,R20
brlo L9
L11:
.dbline 89
; }
; }
; return(i); // 若返回零说明错误
mov R16,R20
.dbline -2
L8:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbend
.dbfunc e fnSTA2 _fnSTA2 fc
; i -> R20
.even
_fnSTA2::
xcall push_gset1
.dbline -1
.dbline 95
; }
; /********************************************/
; /* 检查STA2,如果STA2=1 为自动读状态*/
; /********************************************/
; unsigned char fnSTA2(void)
; {
.dbline 97
; unsigned char i;
; for(i=10;i>0;i--)
ldi R20,10
xjmp L19
L16:
.dbline 98
; {
.dbline 99
; if((RD_LCM() & 0x04) == 0x04)
xcall _RD_LCM
mov R24,R16
andi R24,4
cpi R24,4
brne L20
.dbline 100
; {
.dbline 101
; break;
xjmp L18
L20:
.dbline 103
L17:
.dbline 97
dec R20
L19:
.dbline 97
clr R2
cp R2,R20
brlo L16
L18:
.dbline 104
; }
; }
; return(i); // 若返回零说明错误
mov R16,R20
.dbline -2
L15:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbend
.dbfunc e fnSTA3 _fnSTA3 fc
; i -> R20
.even
_fnSTA3::
xcall push_gset1
.dbline -1
.dbline 110
; }
; /***********************************************/
; /* 状态位STA3 判断STA3 = 1 数据自动写状态*/
; /***********************************************/
; unsigned char fnSTA3(void)
; {
.dbline 112
; unsigned char i;
; for(i=10;i>0;i--)
ldi R20,10
xjmp L26
L23:
.dbline 113
; {
.dbline 114
; if((RD_LCM() & 0x08) == 0x08)
xcall _RD_LCM
mov R24,R16
andi R24,8
cpi R24,8
brne L27
.dbline 115
; {
.dbline 116
; break;
xjmp L25
L27:
.dbline 118
L24:
.dbline 112
dec R20
L26:
.dbline 112
clr R2
cp R2,R20
brlo L23
L25:
.dbline 119
; }
; }
; return(i); // 若返回零说明错误
mov R16,R20
.dbline -2
L22:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbend
.dbfunc e fnSTA6 _fnSTA6 fc
; i -> R20
.even
_fnSTA6::
xcall push_gset1
.dbline -1
.dbline 125
; }
; /************************************************/
; /* 状态位STA6 判断STA6 =1 屏读/屏拷贝状态*/
; /************************************************/
; unsigned char fnSTA6(void)
; {
.dbline 127
; unsigned char i;
; for(i=10;i>0;i--)
ldi R20,10
xjmp L33
L30:
.dbline 128
; {
.dbline 129
; if((RD_LCM() & 0x40) == 0x40)
xcall _RD_LCM
mov R24,R16
andi R24,64
cpi R24,64
brne L34
.dbline 130
; {
.dbline 131
; break;
xjmp L32
L34:
.dbline 133
L31:
.dbline 127
dec R20
L33:
.dbline 127
clr R2
cp R2,R20
brlo L30
L32:
.dbline 134
; }
; }
; return(i); // 若返回零说明错误
mov R16,R20
.dbline -2
L29:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbend
.dbfunc e fnPR1 _fnPR1 fc
; uPar2 -> y+4
; uPar1 -> R22
; uCmd -> R20
.even
_fnPR1::
xcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 140
; }
; /************************/
; /* 写双参数的指令*/
; /************************/
; unsigned char fnPR1(unsigned char uCmd,unsigned char uPar1,unsigned char uPar2)
; {
.dbline 141
; if(fnSTA01() == 0)
xcall _fnSTA01
tst R16
brne L37
.dbline 142
; {
.dbline 143
; return 1;
ldi R16,1
xjmp L36
L37:
.dbline 145
; }
; WR_DAT(uPar1);
mov R16,R22
xcall _WR_DAT
.dbline 146
; if(fnSTA01() == 0)
xcall _fnSTA01
tst R16
brne L39
.dbline 147
; {
.dbline 148
; return 2;
ldi R16,2
xjmp L36
L39:
.dbline 150
; }
; WR_DAT(uPar2);
ldd R16,y+4
xcall _WR_DAT
.dbline 151
; if(fnSTA01() == 0)
xcall _fnSTA01
tst R16
brne L41
.dbline 152
; {
.dbline 153
; return 3;
ldi R16,3
xjmp L36
L41:
.dbline 155
; }
; WR_CMD(uCmd);
mov R16,R20
xcall _WR_CMD
.dbline 156
; return(0); // 返回0 成功
clr R16
.dbline -2
L36:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym l uPar2 4 c
.dbsym r uPar1 22 c
.dbsym r uCmd 20 c
.dbend
.dbfunc e fnPR11 _fnPR11 fc
; uPar1 -> R22
; uCmd -> R20
.even
_fnPR11::
xcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 162
; }
; /************************/
; /* 写单参数的指令*/
; /************************/
; unsigned char fnPR11(unsigned char uCmd,unsigned char uPar1)
; {
.dbline 163
; if(fnSTA01() == 0)
xcall _fnSTA01
tst R16
brne L44
.dbline 164
; {
.dbline 165
; return 1;
ldi R16,1
xjmp L43
L44:
.dbline 167
; }
; WR_DAT(uPar1);
mov R16,R22
xcall _WR_DAT
.dbline 168
; if(fnSTA01() == 0)
xcall _fnSTA01
tst R16
brne L46
.dbline 169
; {
.dbline 170
; return 2;
ldi R16,2
xjmp L43
L46:
.dbline 172
; }
; WR_CMD(uCmd);
mov R16,R20
xcall _WR_CMD
.dbline 173
; return(0); // 返回0 成功
clr R16
.dbline -2
L43:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r uPar1 22 c
.dbsym r uCmd 20 c
.dbend
.dbfunc e fnPR12 _fnPR12 fc
; uCmd -> R20
.even
_fnPR12::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 179
; }
; /************************/
; /* 写无参数的指令*/
; /************************/
; unsigned char fnPR12(unsigned char uCmd)
; {
.dbline 180
; if(fnSTA01() == 0)
xcall _fnSTA01
tst R16
brne L49
.dbline 181
; {
.dbline 182
; return 1;
ldi R16,1
xjmp L48
L49:
.dbline 184
; }
; WR_CMD(uCmd);
mov R16,R20
xcall _WR_CMD
.dbline 185
; return(0); // 返回0 成功
clr R16
.dbline -2
L48:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r uCmd 20 c
.dbend
.dbfunc e fnPR13 _fnPR13 fc
; uData -> R20
.even
_fnPR13::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 191
; }
; /************************/
; /* 写数据*/
; /************************/
; unsigned char fnPR13(unsigned char uData)
; {
.dbline 192
; if(fnSTA3() == 0)
xcall _fnSTA3
tst R16
brne L52
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -