📄 lcd106x56.src
字号:
; {
; SOURCE LINE # 292
; /* here if not byte aligned or an entire byte does not need written */
; /* thus do bit by bit */
; l_display_array[byte_offset][x] &= ~mask;
; SOURCE LINE # 295
MOV B,#06AH
MOV A,R1
MUL AB
ADD A,#LOW (l_display_array)
MOV DPL,A
MOV A,B
ADDC A,#HIGH (l_display_array)
MOV DPH,A
MOV A,DPL
ADD A,R7
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
MOVX A,@DPTR
MOV R3,A
MOV A,R4
CPL A
MOV R2,A
MOV A,R3
ANL A,R2
MOVX @DPTR,A
; if(l_mask_array[0] & 0x80)
; SOURCE LINE # 296
MOV DPTR,#l_mask_array
CLR A
MOVC A,@A+DPTR
MOV R3,A
JNB ACC.7,?C0047
; {
; SOURCE LINE # 297
; mask >>= 1;
; SOURCE LINE # 298
MOV A,R4
CLR C
RRC A
MOV R4,A
; }
; SOURCE LINE # 299
SJMP ?C0048
?C0047:
; else
; {
; SOURCE LINE # 301
; mask <<= 1;
; SOURCE LINE # 302
MOV A,R4
ADD A,ACC
MOV R4,A
; }
; SOURCE LINE # 303
?C0048:
; y_bits--;
; SOURCE LINE # 304
DEC R6
; remaining_bits--;
; SOURCE LINE # 305
DEC R5
; if(remaining_bits == 0)
; SOURCE LINE # 306
MOV A,R5
JNZ ?C0041
; {
; SOURCE LINE # 307
; /* might have bust gotton byte aligned */
; /* so reset for beginning of a byte */
; remaining_bits = 8;
; SOURCE LINE # 310
MOV R5,#08H
; byte_offset++;
; SOURCE LINE # 311
INC R1
; mask = l_mask_array[0];
; SOURCE LINE # 312
MOV R4,AR3
; }
; SOURCE LINE # 313
; }
; SOURCE LINE # 314
; }
; SOURCE LINE # 315
SJMP ?C0041
; }
; SOURCE LINE # 316
?C0040:
INC R7
AJMP ?C0038
; }
; SOURCE LINE # 317
?C0050:
RET
; END OF _lcd_clear_area
;
; /*
; **
; ** Inverts the display memory starting at the left/top and going to
; ** the right/bottom. No runtime error checking is performed. It is
; ** assumed that left is less than right and that top is less than
; ** bottom
; **
; */
;
; void lcd_invert_area(unsigned char left, unsigned char top,
RSEG ?PR?_lcd_invert_area?LCD106X56
_lcd_invert_area:
USING 0
; SOURCE LINE # 328
MOV right?662,R3
;---- Variable 'top?661' assigned to Register 'R1' ----
MOV R1,AR5
;---- Variable 'left?660' assigned to Register 'R7' ----
; unsigned char right, unsigned char bottom)
; {
; SOURCE LINE # 330
; unsigned char bit_pos;
; unsigned char x;
; unsigned char byte_offset;
; unsigned char y_bits;
; unsigned char remaining_bits;
; unsigned char mask;
;
; bit_pos = top & 0x07; /* get starting bit offset into byte */
; SOURCE LINE # 338
MOV A,R1
ANL A,#07H
MOV bit_pos?664,A
;
; for(x = left; x <= right; x++)
; SOURCE LINE # 340
;---- Variable 'x?665' assigned to Register 'R7' ----
?C0051:
MOV A,R7
SETB C
SUBB A,right?662
JC $ + 4H
AJMP ?C0063
; {
; SOURCE LINE # 341
; byte_offset = top >> 3; /* get byte offset into y direction */
; SOURCE LINE # 342
MOV A,R1
RRC A
RRC A
RRC A
ANL A,#01FH
MOV R6,A
;---- Variable 'byte_offset?666' assigned to Register 'R6' ----
; y_bits = (bottom - top) + 1; /* get length in the x direction to write */
; SOURCE LINE # 343
CLR C
MOV A,bottom?663
SUBB A,R1
INC A
MOV R5,A
;---- Variable 'y_bits?667' assigned to Register 'R5' ----
; remaining_bits = 8 - bit_pos; /* number of bits left in byte */
; SOURCE LINE # 344
CLR C
MOV A,#08H
SUBB A,bit_pos?664
MOV R4,A
;---- Variable 'remaining_bits?668' assigned to Register 'R4' ----
; mask = l_mask_array[bit_pos]; /* get mask for this bit */
; SOURCE LINE # 345
MOV A,bit_pos?664
MOV DPTR,#l_mask_array
MOVC A,@A+DPTR
MOV R3,A
;---- Variable 'mask?669' assigned to Register 'R3' ----
?C0054:
;
; while(y_bits) /* while there are still bits to write */
; SOURCE LINE # 347
MOV A,R5
JZ ?C0053
; {
; SOURCE LINE # 348
; if((remaining_bits == 8) && (y_bits > 7))
; SOURCE LINE # 349
MOV A,R4
XRL A,#08H
JNZ ?C0056
MOV A,R5
SETB C
SUBB A,#07H
JC ?C0056
; {
; SOURCE LINE # 350
?C0057:
; /* here if we are byte aligned and have at least 1 byte to write */
; /* do the entire byte at once instead of bit by bit */
; while(y_bits > 7) /* while there are at least 8 more bits to do */
; SOURCE LINE # 353
MOV A,R5
SETB C
SUBB A,#07H
JC ?C0054
; {
; SOURCE LINE # 354
; l_display_array[byte_offset][x] ^= 0xFF;
; SOURCE LINE # 355
MOV B,#06AH
MOV A,R6
MUL AB
ADD A,#LOW (l_display_array)
MOV DPL,A
MOV A,B
ADDC A,#HIGH (l_display_array)
MOV DPH,A
MOV A,DPL
ADD A,R7
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
MOVX A,@DPTR
CPL A
MOVX @DPTR,A
; byte_offset++;
; SOURCE LINE # 356
INC R6
; y_bits -= 8;
; SOURCE LINE # 357
MOV A,#0F8H
ADD A,R5
MOV R5,A
; }
; SOURCE LINE # 358
SJMP ?C0057
; }
; SOURCE LINE # 359
?C0056:
; else
; {
; SOURCE LINE # 361
; /* here if not byte aligned or an entire byte does not need written */
; /* thus do bit by bit */
; l_display_array[byte_offset][x] ^= mask;
; SOURCE LINE # 364
MOV B,#06AH
MOV A,R6
MUL AB
ADD A,#LOW (l_display_array)
MOV DPL,A
MOV A,B
ADDC A,#HIGH (l_display_array)
MOV DPH,A
MOV A,DPL
ADD A,R7
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
MOVX A,@DPTR
XRL A,R3
MOVX @DPTR,A
; if(l_mask_array[0] & 0x80)
; SOURCE LINE # 365
MOV DPTR,#l_mask_array
CLR A
MOVC A,@A+DPTR
MOV R2,A
JNB ACC.7,?C0060
; {
; SOURCE LINE # 366
; mask >>= 1;
; SOURCE LINE # 367
MOV A,R3
CLR C
RRC A
MOV R3,A
; }
; SOURCE LINE # 368
SJMP ?C0061
?C0060:
; else
; {
; SOURCE LINE # 370
; mask <<= 1;
; SOURCE LINE # 371
MOV A,R3
ADD A,ACC
MOV R3,A
; }
; SOURCE LINE # 372
?C0061:
; y_bits--;
; SOURCE LINE # 373
DEC R5
; remaining_bits--;
; SOURCE LINE # 374
DJNZ R4,?C0054
; if(remaining_bits == 0)
; SOURCE LINE # 375
; {
; SOURCE LINE # 376
; /* might have bust gotton byte aligned */
; /* so reset for beginning of a byte */
; remaining_bits = 8;
; SOURCE LINE # 379
MOV R4,#08H
; byte_offset++;
; SOURCE LINE # 380
INC R6
; mask = l_mask_array[0];
; SOURCE LINE # 381
MOV R3,AR2
; }
; SOURCE LINE # 382
; }
; SOURCE LINE # 383
; }
; SOURCE LINE # 384
SJMP ?C0054
; }
; SOURCE LINE # 385
?C0053:
INC R7
AJMP ?C0051
; }
; SOURCE LINE # 386
?C0063:
RET
; END OF _lcd_invert_area
;
; /*
; **
; ** Draws a line into the display memory starting at left going to
; ** right, on the given row. No runtime error checking is performed.
; ** It is assumed that left is less than right.
; **
; */
;
; void lcd_horz_line(unsigned char left, unsigned char right,
RSEG ?PR?_lcd_horz_line?LCD106X56
_lcd_horz_line:
USING 0
; SOURCE LINE # 396
;---- Variable 'left?770' assigned to Register 'R7' ----
;---- Variable 'row?772' assigned to Register 'R3' ----
;---- Variable 'right?771' assigned to Register 'R5' ----
; unsigned char row)
; {
; SOURCE LINE # 398
; unsigned char bit_pos;
; unsigned char byte_offset;
; unsigned char mask;
; unsigned char col;
;
; bit_pos = row & 0x07; /* get the bit offset into a byte */
; SOURCE LINE # 404
MOV A,R3
ANL A,#07H
MOV R6,A
;---- Variable 'bit_pos?773' assigned to Register 'R6' ----
; byte_offset = row >> 3; /* get the byte offset into x array */
; SOURCE LINE # 405
MOV A,R3
RRC A
RRC A
RRC A
ANL A,#01FH
MOV R4,A
;---- Variable 'byte_offset?774' assigned to Register 'R4' ----
; mask = l_mask_array[bit_pos]; /* get the mask for this bit */
; SOURCE LINE # 406
MOV A,R6
MOV DPTR,#l_mask_array
MOVC A,@A+DPTR
MOV R6,A
;---- Variable 'mask?775' assigned to Register 'R6' ----
;
; for(col = left; col <= right; col++)
; SOURCE LINE # 408
;---- Variable 'col?776' assigned to Register 'R7' ----
?C0064:
MOV A,R7
SETB C
SUBB A,R5
JNC ?C0067
; {
; SOURCE LINE # 409
; l_display_array[byte_offset][col] |= mask;
; SOURCE LINE # 410
MOV B,#06AH
MOV A,R4
MUL AB
ADD A,#LOW (l_display_array)
MOV DPL,A
MOV A,B
ADDC A,#HIGH (l_display_array)
MOV DPH,A
MOV A,DPL
ADD A,R7
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
MOVX A,@DPTR
ORL A,R6
MOVX @DPTR,A
; }
; SOURCE LINE # 411
INC R7
SJMP ?C0064
; }
; SOURCE LINE # 412
?C0067:
RET
; END OF _lcd_horz_line
;
; /*
; **
; ** Draws a vertical line into display memory starting at the top
; ** going to the bottom in the given column. No runtime error checking
; ** is performed. It is assumed that top is less than bottom and that
; ** the column is in range.
; **
; */
;
; void lcd_vert_line(unsigned char top, unsigned char bottom,
RSEG ?PR?_lcd_vert_line?LCD106X56
_lcd_vert_line:
USING 0
; SOURCE LINE # 423
;---- Variable 'top?877' assigned to Register 'R7' ----
;---- Variable 'column?879' assigned to Register 'R3' ----
;---- Variable 'bottom?878' assigned to Register 'R5' ----
; unsigned char column)
; {
; SOURCE LINE # 425
; unsigned char bit_pos;
; unsigned char byte_offset;
; unsigned char y_bits;
; unsigned char remaining_bits;
; unsigned char mask;
;
; bit_pos = top & 0x07; /* get starting bit offset into byte */
; SOURCE LINE # 432
MOV A,R7
ANL A,#07H
MOV R6,A
;---- Variable 'bit_pos?880' assigned to Register 'R6' ----
;
; byte_offset = top >> 3; /* get byte offset into y direction */
; SOURCE LINE # 434
MOV A,R7
RRC A
RRC A
RRC A
ANL A,#01FH
MOV R4,A
;---- Variable 'byte_offset?881' assigned to Register 'R4' ----
; y_bits = (bottom - top) + 1; /* get length in the x direction to write */
; SOURCE LINE # 435
CLR C
MOV A,R5
SUBB A,R7
INC A
MOV R7,A
;---- Variable 'y_bits?882' assigned to Register 'R7' ----
; remaining_bits = 8 - bit_pos; /* number of bits left in byte */
; SOURCE LINE # 436
CLR C
MOV A,#08H
SUBB A,R6
MOV R5,A
;---- Variable 'remaining_bits?883' assigned to Register 'R5' ----
; mask = l_mask_array[bit_pos]; /* get mask for this bit */
; SOURCE LINE # 437
MOV A,R6
MOV DPTR,#l_mask_array
MOVC A,@A+DPTR
MOV R6,A
;---- Variable 'mask?884' assigned to Register 'R6' ----
?C0068:
;
; while(y_bits) /* while there are still bits to write */
; SOURCE LINE # 439
MOV A,R7
JZ ?C0077
; {
; SOURCE LINE # 440
; if((remaining_bits == 8) && (y_bits > 7))
; SOURCE LINE # 441
CJNE R5,#08H,?C0070
SETB C
SUBB A,#07H
JC ?C0070
; {
; SOURCE LINE # 442
?C0071:
; /* here if we are byte aligned and have at least 1 byte to write */
; /* do the entire byte at once instead of bit by bit */
; while(y_bits > 7) /* while there are at least 8 more bits to do */
; SOURCE LINE # 445
MOV A,R7
SETB C
SUBB A,#07H
JC ?C0068
; {
; SOURCE LINE # 446
; l_display_array[byte_offset][column] = 0xFF;
; SOURCE LINE # 447
MOV B,#06AH
MOV A,R4
MUL AB
ADD A,#LOW (l_display_array)
MOV DPL,A
MOV A,B
ADDC A,#HIGH (l_display_array)
MOV DPH,A
MOV A,DPL
ADD A,R3
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
MOV A,#0FFH
MOVX @DPTR,A
; byte_offset++;
; SOURCE LINE # 448
INC R4
; y_bits -= 8;
; SOURCE LINE # 449
MOV A,#0F8H
ADD A,R7
MOV R7,A
; }
; SOURCE LINE # 450
SJMP ?C0071
; }
; SOURCE LINE # 451
?C0070:
; else
; {
; SOURCE LINE # 453
; /* we are not byte aligned or an entire byte does not need written */
; /* do each individual bit */
; l_display_array[byte_offset][column] |= mask;
; SOURCE LINE # 456
MOV B,#06AH
MOV A,R4
MUL AB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -