📄 print.lst
字号:
C51 COMPILER V8.05a PRINT 12/25/2007 01:05:22 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE PRINT
OBJECT MODULE PLACED IN .\print.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\51demo\print.c DEBUG OBJECTEXTEND PRINT(.\print.lst) OBJECT(.\print.obj)
line level source
1
2 /****************************************************************************
3 * 公司名称:SITRONIX *
4 * 模块名称:PRINT.C *
5 * 模块功能:在屏幕上打印ASC *
6 * 创建人员:Jim Yuan *
7 * 创建日期:2007-6-8 *
8 * 修改日期:2007-6-26 *
9 ****************************************************************************/
10
11 #include "print.h"
12
13 #if ASC_FONT == FONT_8
#include "asc_8x8.h"
#endif
16
17 #if ASC_FONT == FONT_16
18 #include "asc_8x16.h"
19 #endif
20
21 uint8 asc_height = ASC_FONT;
22 uint8 asc_width = 8;
23
24 /****************************************************************************
25 * 函数名称:print_asc *
26 * 函数功能:在屏幕上打印一个ASC字符 *
27 * 入口参数:asc ASC数值 *
28 * 出口参数:无 *
29 * 创建日期:2007-6-8 *
30 * 修改日期:2007-6-26 *
31 * 修改原因:增加字体颜色和背景颜色设置 *
32 ****************************************************************************/
33 void print_asc(uint8 asc)
34 {
35 1 uint8 i,j;
36 1 uint8 tmp;
37 1 for(i = 0;i < asc_height; i++)
38 1 {
39 2 tmp = asc_lib[asc - 0x20][i];
40 2 for(j = 0; j < asc_width; j++)
41 2 {
42 3 if (((tmp << j) & 0x80) == 0x80)
43 3 {
44 4 disp_data(FONT_COLOR >> 8);
45 4 disp_data(FONT_COLOR & 0x0f);
46 4 }
47 3 else
48 3 {
49 4 disp_data(BACK_COLOR >> 8);
50 4 disp_data(BACK_COLOR & 0x0f);
51 4 }
52 3 }
53 2 }
54 1 }
55
C51 COMPILER V8.05a PRINT 12/25/2007 01:05:22 PAGE 2
56 /****************************************************************************
57 * 函数名称:print_string *
58 * 函数功能:在屏幕上打印ASC字符串 *
59 * 入口参数:row 显示行 *
60 * column 显示列 *
61 * *str 显示内容 *
62 * 出口参数:无 *
63 * 创建日期:2007-6-8 *
64 * 修改日期:2007-6-26 *
65 * 修改原因:增加行,列自动计算,行/列最小值为0/0 *
66 ****************************************************************************/
67 void print_string(uint16 row, uint16 column, uint8 *str)
68 {
69 1 uint16 r,c;
70 1 r = row;
71 1 c = column;
72 1 while (*str != '\0')
73 1 {
74 2 if (disp_area(c * asc_width, r * asc_height, asc_width, asc_height) == FALSE){return;}
75 2 print_asc(*str++);
76 2 c++;
77 2 }
78 1 }
79
80 /*ASC数值 --- ASC字符转换*/
81 code uint8 asc_table[] = "0123456789ABCDEF";
82 static char hex2ch(char hex)
83 {
84 1 return asc_table[hex];
85 1 }
86
87 /****************************************************************************
88 * 函数名称:print_hex *
89 * 函数功能:在屏幕上打印ASC字符串 *
90 * 入口参数:row 显示行 *
91 * column 显示列 *
92 * hex 显示内容 *
93 * 出口参数:无 *
94 * 创建日期:2007-6-8 *
95 * 修改日期:2007-6-26 *
96 * 修改原因:增加行,列自动计算,行/列最小值为0/0 *
97 ****************************************************************************/
98 void print_hex(uint16 row, uint16 column, uint8 hex)
99 {
100 1 uint16 i,c,r;
101 1 uint8 table[4];
102 1 table[0] = '0';
103 1 table[1] = 'x';
104 1 table[2] = hex2ch(hex >> 4);
105 1 table[3] = hex2ch(hex & 0x0f);
106 1 r = row;
107 1 c = column;
108 1 for (i = 0;i < 4;i++)
109 1 {
110 2 if (disp_area(c * asc_width, r * asc_height, asc_width, asc_height) == FALSE){return;}
111 2 print_asc(table[i]);
112 2 c++;
113 2 }
114 1 }
115
C51 COMPILER V8.05a PRINT 12/25/2007 01:05:22 PAGE 3
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 353 ----
CONSTANT SIZE = 1553 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 2 23
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -