📄 12864_example.s
字号:
.dbfunc e sendCommandToLCD _sendCommandToLCD fV
; Command -> R20
.even
_sendCommandToLCD::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 141
.dbline 142
xcall _waitForLCDReady
.dbline 144
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,254
std z+0,R24
.dbline 144
.dbline 144
.dbline 145
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,253
std z+0,R24
.dbline 145
.dbline 145
.dbline 145
.dbline 149
lds R24,_VPORT
lds R25,_VPORT+1
andi R25,0
sts _VPORT+1,R25
sts _VPORT,R24
.dbline 149
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 149
xcall _refreshVirtualPORT
.dbline 149
.dbline 151
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,4
std z+0,R24
.dbline 151
xcall _refreshVirtualPORT
.dbline 151
.dbline 151
.dbline 152
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,251
std z+0,R24
.dbline 152
xcall _refreshVirtualPORT
.dbline 152
.dbline 152
.dbline -2
L29:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r Command 20 c
.dbend
.dbfunc e setX _setX fV
; X -> R20
.even
_setX::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 160
.dbline 161
andi R20,7
.dbline 162
ori R20,184
.dbline 164
mov R16,R20
xcall _sendCommandToLCD
.dbline -2
L30:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r X 20 c
.dbend
.dbfunc e setY _setY fV
; Y -> R20
.even
_setY::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 172
.dbline 173
andi R20,63
.dbline 174
ori R20,64
.dbline 176
mov R16,R20
xcall _sendCommandToLCD
.dbline -2
L31:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r Y 20 c
.dbend
.dbfunc e setStartLine _setStartLine fV
; Y -> R20
.even
_setStartLine::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 184
.dbline 185
andi R20,7
.dbline 186
ori R20,192
.dbline 188
mov R16,R20
xcall _sendCommandToLCD
.dbline -2
L32:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r Y 20 c
.dbend
.dbfunc e setLCDOnOFF _setLCDOnOFF fV
; State -> R20
.even
_setLCDOnOFF::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 196
.dbline 197
ori R20,62
.dbline 199
mov R16,R20
xcall _sendCommandToLCD
.dbline -2
L33:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r State 20 c
.dbend
.dbfunc e LCDDraw _LCDDraw fV
; Data -> y+4
; Y -> R20
; X -> R22
.even
_LCDDraw::
xcall push_gset2
mov R20,R18
mov R22,R16
.dbline -1
.dbline 207
.dbline 208
mov R16,R22
xcall _setX
.dbline 210
ldi R24,63
cp R24,R20
brsh L35
.dbline 211
.dbline 212
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,16
std z+0,R24
.dbline 212
.dbline 212
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,247
std z+0,R24
.dbline 212
.dbline 212
.dbline 213
mov R16,R20
subi R16,64
xcall _setY
.dbline 214
xjmp L36
L35:
.dbline 216
.dbline 217
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,8
std z+0,R24
.dbline 217
.dbline 217
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,239
std z+0,R24
.dbline 217
.dbline 217
.dbline 218
mov R16,R20
xcall _setY
.dbline 219
L36:
.dbline 221
ldd R16,y+4
xcall _sendDataToLCD
.dbline -2
L34:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym l Data 4 c
.dbsym r Y 20 c
.dbsym r X 22 c
.dbend
.dbfunc e ClearLCD _ClearLCD fV
; a -> R20
; b -> R22
.even
_ClearLCD::
xcall push_gset2
.dbline -1
.dbline 228
.dbline 229
clr R20
.dbline 229
clr R22
.dbline 230
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,8
std z+0,R24
.dbline 230
.dbline 230
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,16
std z+0,R24
.dbline 230
.dbline 230
.dbline 231
clr R16
xcall _setX
.dbline 232
clr R16
xcall _setY
.dbline 234
; char a = 0,b=0,n=0;
; SystemInit();
xjmp L41
L38:
.dbline 235
;
.dbline 236
; LCD12864DispPicture(LOGO,128,64,0,0);
mov R16,R20
xcall _setX
.dbline 237
;
clr R22
xjmp L45
L42:
.dbline 238
.dbline 239
clr R16
xcall _sendDataToLCD
.dbline 240
L43:
.dbline 237
inc R22
L45:
.dbline 237
cpi R22,64
brlo L42
.dbline 241
L39:
.dbline 234
inc R20
L41:
.dbline 234
cpi R20,8
brlo L38
.dbline -2
L37:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r a 20 c
.dbsym r b 22 c
.dbend
.dbfunc e LCD12864Init _LCD12864Init fV
.even
_LCD12864Init::
.dbline -1
.dbline 248
;
; while(1)
; {
; n++;
; if (n == 64)
; {
; n = 0;
; }
; LCD12864_ChooseBoth;
; setX(7);
; setY(n);
.dbline 249
; sendDataToLCD(0xff);
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,223
std z+0,R24
.dbline 249
xcall _refreshVirtualPORT
.dbline 249
.dbline 249
.dbline 250
; sendDataToLCD(0x00);
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,32
std z+0,R24
.dbline 250
xcall _refreshVirtualPORT
.dbline 250
.dbline 250
.dbline 251
; sendDataToLCD(0x00);
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,8
std z+0,R24
.dbline 251
.dbline 251
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,16
std z+0,R24
.dbline 251
.dbline 251
.dbline 253
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
ldi R16,62
xcall _setLCDOnOFF
.dbline 253
.dbline 255
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
clr R16
xcall _setX
.dbline 256
; sendDataToLCD(0x00);
clr R16
xcall _setStartLine
.dbline 257
; sendDataToLCD(0x00);
clr R16
xcall _setY
.dbline 259
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
ldi R16,63
xcall _setLCDOnOFF
.dbline 259
.dbline 260
; sendDataToLCD(0x00);
xcall _ClearLCD
.dbline -2
L46:
.dbline 0 ; func end
ret
.dbend
.dbfunc e LCD12864DispPicture _LCD12864DispPicture fV
; Y -> R20
; X -> R22
; Left -> y+14
; Top -> y+12
; Height -> R12
; Width -> R14
; PIC -> R10,R11
.even
_LCD12864DispPicture::
xcall push_gset5
mov R14,R18
movw R10,R16
ldd R12,y+10
.dbline -1
.dbline 268
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
; sendDataToLCD(0x00);
;
.dbline 269
; }
clr R22
.dbline 269
clr R20
.dbline 271
; }
; }
xjmp L51
L48:
.dbline 272
; }
.dbline 273
; }
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,8
std z+0,R24
.dbline 273
.dbline 273
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,16
std z+0,R24
.dbline 273
.dbline 273
.dbline 274
; }
mov R16,R20
xcall _setX
.dbline 275
; }
clr R22
xjmp L55
L52:
.dbline 276
; }
.dbline 277
; }
cpi R22,64
brsh L56
.dbline 278
; }
.dbline 280
; }
; }
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,8
std z+0,R24
.dbline 280
.dbline 280
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,239
std z+0,R24
.dbline 280
.dbline 280
.dbline 281
; }
mov R16,R22
xcall _setY
.dbline 282
; }
xjmp L57
L56:
.dbline 284
; }
; }
.dbline 285
; }
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
ori R24,16
std z+0,R24
.dbline 285
.dbline 285
lds R30,_VPORTBit
lds R31,_VPORTBit+1
ldd R24,z+0
andi R24,247
std z+0,R24
.dbline 285
.dbline 285
.dbline 286
; }
mov R16,R22
subi R16,64
xcall _setY
.dbline 287
; }
L57:
.dbline 288
mul R20,R14
movw R30,R0
mov R2,R22
clr R3
add R30,R2
adc R31,R3
add R30,R10
adc R31,R11
lpm R16,Z
xcall _sendDataToLCD
.dbline 289
L53:
.dbline 275
inc R22
L55:
.dbline 275
cp R22,R14
brsh X1
xjmp L52
X1:
.dbline 290
L49:
.dbline 271
inc R20
L51:
.dbline 271
mov R2,R12
lsr R2
lsr R2
lsr R2
cp R20,R2
brsh X2
xjmp L48
X2:
.dbline -2
L47:
xcall pop_gset5
.dbline 0 ; func end
ret
.dbsym r Y 20 c
.dbsym r X 22 c
.dbsym l Left 14 c
.dbsym l Top 12 c
.dbsym r Height 12 c
.dbsym r Width 14 c
.dbsym r PIC 10 pkc
.dbend
.area data(ram, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_LCD12864.h
_FlashGIFStringCounter::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile G:\单片机\源程序\液晶12864驱动\CGM12864\LCD12864_Example/RD_LCD12864.h
.dbfile 12864_Example.c
.dbsym e FlashGIFStringCounter _FlashGIFStringCounter i
_FlashTimeCounter::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile 12864_Example.c
.dbsym e FlashTimeCounter _FlashTimeCounter i
.area lit(rom, con, rel)
_LOGO::
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 64,192
.byte 192,224
.byte 224,96
.byte 64,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,136
.byte 248,248
.byte 192,64
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,64
.byte 64,224
.byte 240,176
.byte 160,160
.byte 224,64
.byte 0,248
.byte 248,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 224,192
.byte 0,0
.byte 0,240
.byte 240,128
.byte 128,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 240,240
.byte 224,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,224
.byte 224,144
.byte 184,240
.byte 224,184
.byte 152,128
.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 24,'x
.byte 240,16
.byte 248,252
.byte 140,200
.byte 255,143
.byte 134,252
.byte 252,56
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,240
.byte 240,17
.byte 91,255
.byte 255,255
.byte 254,166
.byte 4,4
.byte 252,248
.byte 8,0
.byte 0,0
.byte 0,4
.byte 14,'n
.byte 126,255
.byte 255,29
.byte 47,39
.byte 55,26
.byte 12,255
.byte 255,2
.byte 2,0
.byte 0,0
.byte 0,0
.byte 8,156
.byte 220,254
.byte 127,59
.byte 44,'f
.byte 238,223
.byte 251,177
.byte 0,0
.byte 0,0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -