📄 lcd106x56.src
字号:
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
MOVX A,@DPTR
ORL A,R6
MOVX @DPTR,A
; if(l_mask_array[0] & 0x80)
; SOURCE LINE # 457
MOV DPTR,#l_mask_array
CLR A
MOVC A,@A+DPTR
MOV R2,A
JNB ACC.7,?C0074
; {
; SOURCE LINE # 458
; mask >>= 1;
; SOURCE LINE # 459
MOV A,R6
CLR C
RRC A
MOV R6,A
; }
; SOURCE LINE # 460
SJMP ?C0075
?C0074:
; else
; {
; SOURCE LINE # 462
; mask <<= 1;
; SOURCE LINE # 463
MOV A,R6
ADD A,ACC
MOV R6,A
; }
; SOURCE LINE # 464
?C0075:
; y_bits--;
; SOURCE LINE # 465
DEC R7
; remaining_bits--;
; SOURCE LINE # 466
DJNZ R5,?C0068
; if(remaining_bits == 0)
; SOURCE LINE # 467
; {
; SOURCE LINE # 468
; /* might have bust gotton byte aligned */
; /* so reset for beginning of a byte */
; remaining_bits = 8;
; SOURCE LINE # 471
MOV R5,#08H
; byte_offset++;
; SOURCE LINE # 472
INC R4
; mask = l_mask_array[0];
; SOURCE LINE # 473
MOV R6,AR2
; }
; SOURCE LINE # 474
; }
; SOURCE LINE # 475
; }
; SOURCE LINE # 476
SJMP ?C0068
; }
; SOURCE LINE # 477
?C0077:
RET
; END OF _lcd_vert_line
;
; /*
; **
; ** Clears 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_clr_horz_line(unsigned char left, unsigned char right,
RSEG ?PR?_lcd_clr_horz_line?LCD106X56
_lcd_clr_horz_line:
USING 0
; SOURCE LINE # 487
;---- Variable 'left?985' assigned to Register 'R7' ----
;---- Variable 'row?987' assigned to Register 'R3' ----
;---- Variable 'right?986' assigned to Register 'R5' ----
; unsigned char row)
; {
; SOURCE LINE # 489
; 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 # 495
MOV A,R3
ANL A,#07H
MOV R6,A
;---- Variable 'bit_pos?988' assigned to Register 'R6' ----
; byte_offset = row >> 3; /* get the byte offset into x array */
; SOURCE LINE # 496
MOV A,R3
RRC A
RRC A
RRC A
ANL A,#01FH
MOV R4,A
;---- Variable 'byte_offset?989' assigned to Register 'R4' ----
; mask = l_mask_array[bit_pos]; /* get the mask for this bit */
; SOURCE LINE # 497
MOV A,R6
MOV DPTR,#l_mask_array
MOVC A,@A+DPTR
MOV R6,A
;---- Variable 'mask?990' assigned to Register 'R6' ----
;
; for(col = left; col <= right; col++)
; SOURCE LINE # 499
;---- Variable 'col?991' assigned to Register 'R7' ----
?C0078:
MOV A,R7
SETB C
SUBB A,R5
JNC ?C0081
; {
; SOURCE LINE # 500
; l_display_array[byte_offset][col] &= ~mask;
; SOURCE LINE # 501
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
MOV R3,A
MOV A,R6
CPL A
MOV R2,A
MOV A,R3
ANL A,R2
MOVX @DPTR,A
; }
; SOURCE LINE # 502
INC R7
SJMP ?C0078
; }
; SOURCE LINE # 503
?C0081:
RET
; END OF _lcd_clr_horz_line
;
;
; /*
; **
; ** Clears 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_clr_vert_line(unsigned char top, unsigned char bottom,
RSEG ?PR?_lcd_clr_vert_line?LCD106X56
_lcd_clr_vert_line:
USING 0
; SOURCE LINE # 515
;---- Variable 'top?1092' assigned to Register 'R7' ----
;---- Variable 'column?1094' assigned to Register 'R1' ----
MOV R1,AR3
;---- Variable 'bottom?1093' assigned to Register 'R5' ----
; unsigned char column)
; {
; SOURCE LINE # 517
; 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 # 524
MOV A,R7
ANL A,#07H
MOV R6,A
;---- Variable 'bit_pos?1095' assigned to Register 'R6' ----
;
; byte_offset = top >> 3; /* get byte offset into y direction */
; SOURCE LINE # 526
MOV A,R7
RRC A
RRC A
RRC A
ANL A,#01FH
MOV R4,A
;---- Variable 'byte_offset?1096' assigned to Register 'R4' ----
; y_bits = (bottom - top) + 1; /* get length in the x direction to write */
; SOURCE LINE # 527
CLR C
MOV A,R5
SUBB A,R7
INC A
MOV R7,A
;---- Variable 'y_bits?1097' assigned to Register 'R7' ----
; remaining_bits = 8 - bit_pos; /* number of bits left in byte */
; SOURCE LINE # 528
CLR C
MOV A,#08H
SUBB A,R6
MOV R5,A
;---- Variable 'remaining_bits?1098' assigned to Register 'R5' ----
; mask = l_mask_array[bit_pos]; /* get mask for this bit */
; SOURCE LINE # 529
MOV A,R6
MOV DPTR,#l_mask_array
MOVC A,@A+DPTR
MOV R6,A
;---- Variable 'mask?1099' assigned to Register 'R6' ----
?C0082:
;
; while(y_bits) /* while there are still bits to write */
; SOURCE LINE # 531
MOV A,R7
JZ ?C0091
; {
; SOURCE LINE # 532
; if((remaining_bits == 8) && (y_bits > 7))
; SOURCE LINE # 533
CJNE R5,#08H,?C0084
SETB C
SUBB A,#07H
JC ?C0084
; {
; SOURCE LINE # 534
?C0085:
; /* 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 # 537
MOV A,R7
SETB C
SUBB A,#07H
JC ?C0082
; {
; SOURCE LINE # 538
; l_display_array[byte_offset][column] = 0x00;
; SOURCE LINE # 539
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,R1
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
CLR A
MOVX @DPTR,A
; byte_offset++;
; SOURCE LINE # 540
INC R4
; y_bits -= 8;
; SOURCE LINE # 541
MOV A,#0F8H
ADD A,R7
MOV R7,A
; }
; SOURCE LINE # 542
SJMP ?C0085
; }
; SOURCE LINE # 543
?C0084:
; else
; {
; SOURCE LINE # 545
; /* 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 # 548
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,R1
MOV DPL,A
CLR A
ADDC A,DPH
MOV DPH,A
MOVX A,@DPTR
MOV R3,A
MOV A,R6
CPL A
MOV R2,A
MOV A,R3
ANL A,R2
MOVX @DPTR,A
; if(l_mask_array[0] & 0x80)
; SOURCE LINE # 549
MOV DPTR,#l_mask_array
CLR A
MOVC A,@A+DPTR
MOV R3,A
JNB ACC.7,?C0088
; {
; SOURCE LINE # 550
; mask >>= 1;
; SOURCE LINE # 551
MOV A,R6
CLR C
RRC A
MOV R6,A
; }
; SOURCE LINE # 552
SJMP ?C0089
?C0088:
; else
; {
; SOURCE LINE # 554
; mask <<= 1;
; SOURCE LINE # 555
MOV A,R6
ADD A,ACC
MOV R6,A
; }
; SOURCE LINE # 556
?C0089:
; y_bits--;
; SOURCE LINE # 557
DEC R7
; remaining_bits--;
; SOURCE LINE # 558
DEC R5
; if(remaining_bits == 0)
; SOURCE LINE # 559
MOV A,R5
JNZ ?C0082
; {
; SOURCE LINE # 560
; /* might have bust gotton byte aligned */
; /* so reset for beginning of a byte */
; remaining_bits = 8;
; SOURCE LINE # 563
MOV R5,#08H
; byte_offset++;
; SOURCE LINE # 564
INC R4
; mask = l_mask_array[0];
; SOURCE LINE # 565
MOV R6,AR3
; }
; SOURCE LINE # 566
; }
; SOURCE LINE # 567
; }
; SOURCE LINE # 568
SJMP ?C0082
; }
; SOURCE LINE # 569
?C0091:
RET
; END OF _lcd_clr_vert_line
;
; /*
; **
; ** Draws a box in 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_box(unsigned char left, unsigned char top,
RSEG ?PR?_lcd_box?LCD106X56
_lcd_box:
USING 0
; SOURCE LINE # 580
MOV left?11100,R7
MOV top?11101,R5
;---- Variable 'right?11102' assigned to Register 'R1' ----
MOV R1,AR3
; unsigned char right, unsigned char bottom)
; {
; SOURCE LINE # 582
; /* to draw a box requires two vertical lines */
; lcd_vert_line(top,bottom,left);
; SOURCE LINE # 584
MOV R3,left?11100
MOV R5,bottom?11103
MOV R7,top?11101
LCALL _lcd_vert_line
; lcd_vert_line(top,bottom,right);
; SOURCE LINE # 585
MOV R3,AR1
MOV R5,bottom?11103
MOV R7,top?11101
LCALL _lcd_vert_line
;
; /* and two horizonal lines */
; lcd_horz_line(left,right,top);
; SOURCE LINE # 588
MOV R5,AR1
MOV R3,top?11101
MOV R7,left?11100
LCALL _lcd_horz_line
; lcd_horz_line(left,right,bottom);
; SOURCE LINE # 589
MOV R3,bottom?11103
MOV R7,left?11100
LJMP _lcd_horz_line
; END OF _lcd_box
; }
;
; /*
; **
; ** Clears a box in display memory starting at the Top left and going
; ** to the bottom right. No runtime error checking is performed and
; ** it is assumed that Left is less than Right and that Top is less
; ** than Bottom.
; **
; */
;
; void lcd_clr_box(unsigned char left, unsigned char top,
RSEG ?PR?_lcd_clr_box?LCD106X56
_lcd_clr_box:
USING 0
; SOURCE LINE # 601
MOV left?12104,R7
MOV top?12105,R5
MOV right?12106,R3
; unsigned char right, unsigned char bottom)
; {
; SOURCE LINE # 603
; /* to undraw the box undraw the two vertical lines */
; lcd_clr_vert_line(top,bottom,left);
; SOURCE LINE # 605
MOV R3,left?12104
MOV R5,bottom?12107
MOV R7,top?12105
LCALL _lcd_clr_vert_line
; lcd_clr_vert_line(top,bottom,right);
; SOURCE LINE # 606
MOV R3,right?12106
MOV R5,bottom?12107
MOV R7,top?12105
LCALL _lcd_clr_vert_line
;
; /* and the two horizonal lines that comprise it */
; lcd_clr_horz_line(left,right,top);
; SOURCE LINE # 609
MOV R3,top?12105
MOV R5,right?12106
MOV R7,left?12104
LCALL _lcd_clr_horz_line
; lcd_clr_horz_line(left,right,bottom);
; SOURCE LINE # 610
MOV R3,bottom?12107
MOV R5,right?12106
MOV R7,left?12104
LJMP _lcd_clr_horz_line
; END OF _lcd_clr_box
; }
;
; /*
; **
; ** Writes a glyph to the display at location x,y
; **
; ** Arguments are:
; ** column - x corrdinate of the left part of glyph
; ** row - y coordinate of the top part of glyph
; ** width - size in pixels of the width of the glyph
; ** height - size in pixels of the height of the glyph
; ** glyph - an unsigned char pointer to the glyph pixels
; ** to write assumed to be of length "width"
; **
; */
;
; void lcd_glyph(unsigned char left, unsigned char top,
RSEG ?PR?_lcd_glyph?LCD106X56
_lcd_glyph:
USING 0
; SOURCE LINE # 627
MOV left?13108,R7
MOV top?13109,R5
MOV width?13110,R3
; unsigned char width, unsigned char height,
; unsigned char *glyph, unsigned char store_width)
; {
; SOURCE LINE # 630
; unsigned char bit_pos;
; unsigned char byte_offset;
; unsigned char y_bits;
; unsigned char remaining_bits;
; unsigned char mask;
; unsigned char char_mask;
; unsigned char x;
; unsigned char *glyph_scan;
; unsigned char glyph_offset;
;
; bit_pos = top & 0x07; /* get the bit offset into a byte */
; SOURCE LINE # 641
MOV A,top?13109
ANL A,#07H
MOV bit_pos?13114,A
;
; glyph_offset = 0; /* start at left side of the glyph rasters */
; SOURCE LINE # 643
CLR A
MOV glyph_offset?13122,A
; char_mask = 0x80; /* initial character glyph mask */
; SOURCE LINE # 644
MOV char_mask?13119,#080H
;
; for (x = left; x < (left + width); x++)
; SOURCE LINE # 646
MOV x?13120,left?13108
?C0094:
MOV A,left?13108
ADD A,width?13110
MOV R7,A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -