demo_funs.LST
资源名称:meun.rar [点击查看]
上传用户:nbddcb
上传日期:2022-05-19
资源大小:48k
文件大小:12k
源码类别:
菜单
开发平台:
Visual C++
- C51 COMPILER V7.50 DEMO_FUNS 01/13/2010 18:22:38 PAGE 1
- C51 COMPILER V7.50, COMPILATION OF MODULE DEMO_FUNS
- OBJECT MODULE PLACED IN demo_funs.OBJ
- COMPILER INVOKED BY: C:KeilC51BINC51.EXE demo_funs.c BROWSE DEBUG OBJECTEXTEND
- line level source
- 1 #include <REGX51.H>
- 2 #include "demo_funs.h"
- 3 #include "demo.h"
- 4
- 5 extern UCHAR synchronization;
- 6
- 7 void MainLoop ()
- 8 {
- 9 1 static UCHAR color=0,i=0;
- 10 1
- 11 1 //循环显示"盛恒泰科技"
- 12 1 //MB90092_ClearXY (i,11);
- 13 1 MB90092_DisChar (i,11,0x1E0+i,3,0,++color%7,0);
- 14 1 i=++i%5;
- 15 1 Delay_ms (10);
- 16 1 }
- 17
- 18 void DemoLogo ()
- 19 {
- 20 1 UCHAR i;
- 21 1
- 22 1 //显示公司徽标
- 23 1 i=6;
- 24 1 MB90092_DisChar (i,1,0x1F0,1,2,C_COLOR_RED,0);
- 25 1 MB90092_DisChar (i+1,1,0x1F1,1,2,C_COLOR_RED,0);
- 26 1 MB90092_DisChar (i+2,1,0x1F2,1,2,C_COLOR_BLUE,0);
- 27 1 MB90092_DisChar (i+3,1,0x1F3,1,2,C_COLOR_BLUE,0);
- 28 1 MB90092_DisChar (i+4,1,0x1F4,1,2,C_COLOR_BLUE,0);
- 29 1
- 30 1 MB90092_DisChar (i,2,0x200,1,2,C_COLOR_RED,0);
- 31 1 MB90092_DisChar (i+1,2,0x201,1,2,C_COLOR_RED,0);
- 32 1 MB90092_DisChar (i+2,2,0x202,1,2,C_COLOR_BLUE,0);
- 33 1 MB90092_DisChar (i+3,2,0x203,1,2,C_COLOR_BLUE,0);
- 34 1 MB90092_DisChar (i+4,2,0x204,1,2,C_COLOR_BLUE,0);
- 35 1
- 36 1 //显示"MB90092"
- 37 1 i=3;
- 38 1 MB90092_DisChar (i-1,7,'M',2,1,C_COLOR_BLUE,0);
- 39 1 MB90092_DisChar (i,7,'B',2,1,C_COLOR_BLUE,0);
- 40 1 MB90092_DisChar (i+1,7,'9',2,1,C_COLOR_BLUE,0);
- 41 1 MB90092_DisChar (i+2,7,'0',2,1,C_COLOR_BLUE,0);
- 42 1 MB90092_DisChar (i+3,7,'0',2,1,C_COLOR_BLUE,0);
- 43 1 MB90092_DisChar (i+4,7,'9',2,1,C_COLOR_BLUE,0);
- 44 1 MB90092_DisChar (i+5,7,'2',2,1,C_COLOR_BLUE,0);
- 45 1 //显示"演示系统"
- 46 1 MB90092_DisChar (i,10,0xb0,2,2,C_COLOR_RED,0);
- 47 1 MB90092_DisChar (i+1,10,0xb1,2,2,C_COLOR_RED,0);
- 48 1 MB90092_DisChar (i+2,10,0xb2,2,2,C_COLOR_RED,0);
- 49 1 MB90092_DisChar (i+3,10,0xb3,2,2,C_COLOR_RED,0);
- 50 1
- 51 1 for (i=0;i<5;i++)
- 52 1 MB90092_DisChar (i+6,3,0x1E0+i,1,2,C_COLOR_BLUE+i,0);
- 53 1 }
- 54
- 55
- C51 COMPILER V7.50 DEMO_FUNS 01/13/2010 18:22:38 PAGE 2
- 56 void DemoAll ()
- 57 {
- 58 1 UCHAR i;
- 59 1 //ASCII code
- 60 1 for (i=0;i<24;i++)
- 61 1 MB90092_DisChar(i,0,i%10,2,0,7,1);
- 62 1 for (i=0;i<24;i++)
- 63 1 MB90092_DisChar(i,1,0x30+i%10,0,1,6,1);
- 64 1 for (i=0;i<24;i++)
- 65 1 MB90092_DisChar(i,2,0x41+i,0,2,0,1);
- 66 1
- 67 1 for (i=0;i<24;i++)
- 68 1 MB90092_DisChar(i,3,0x61+i,0,3,7,1);
- 69 1 for (i=0;i<24;i++)
- 70 1 MB90092_DisChar(i,4,0xC0+i,0,7,1,1);
- 71 1 for (i=0;i<24;i++)
- 72 1 MB90092_DisChar(i,5,0xE0+i,0,5,1,1);
- 73 1
- 74 1 for (i=0;i<24;i++)
- 75 1 MB90092_DisChar(i,6,0x100+i,0,6,1,1);
- 76 1 for (i=0;i<24;i++)
- 77 1 MB90092_DisChar(i,7,0x120+i,0,7,0,1);
- 78 1 for (i=0;i<13;i++)
- 79 1 MB90092_DisChar(i+4,8,0x162+i,0,0,7,1);
- 80 1 for (i=0;i<13;i++)
- 81 1 MB90092_DisChar(i+4,9,0x180+i,0,i%7+1,0,1);
- 82 1 for (i=0;i<13;i++)
- 83 1 MB90092_DisChar(i+4,10,0x180+i,0,7,0,1);
- 84 1 }
- 85
- 86 void DemoFontSize ()
- 87 {
- 88 1 UCHAR i;
- 89 1 //字体大小演示
- 90 1 MB90092_DisChar(0,1,0xb4,7,7,0,0);
- 91 1 MB90092_DisChar(1,1,0xb5,7,7,0,0);
- 92 1 MB90092_DisChar(2,1,0xb6,7,7,0,0);
- 93 1 MB90092_DisChar(3,1,0xb7,7,7,0,0);
- 94 1 MB90092_DisChar(4,1,':', 7,7,0,0);
- 95 1
- 96 1
- 97 1 for(i=0;i<7;i++)
- 98 1 //MB90092_DisChar(8+i,4,0x1C0+i,7,1,i%7,0);
- 99 1 MB90092_DisChar(8+i,3,0x1C0+i,7,1,i%7,0);
- 100 1 for(i=0;i<7;i++)
- 101 1 //MB90092_DisChar(2+i,6,0x1C0+i,2,1,i%7,0);
- 102 1 MB90092_DisChar(2+i,5,0x1C0+i,2,1,i%7,0);
- 103 1 for(i=0;i<3;i++)
- 104 1 // MB90092_DisChar(i+1,8,0x1C0+i,3,1,i%7,0);
- 105 1 MB90092_DisChar(i+1,8,0x1C0+i,3,1,i%7,0);
- 106 1 }
- 107
- 108 void DemoCount ()
- 109 {
- 110 1 static int count=0;
- 111 1 //计数器演示
- 112 1 MB90092_DisChar(0,2,0xBA,7,0,0,0);
- 113 1 MB90092_DisChar(1,2,0xBB,7,0,0,0);
- 114 1 MB90092_DisChar(2,2,0xBC,7,0,0,0);
- 115 1 MB90092_DisChar(3,2,':', 7,0,0,0);
- 116 1
- 117 1 count++;
- C51 COMPILER V7.50 DEMO_FUNS 01/13/2010 18:22:38 PAGE 3
- 118 1 MB90092_DisChar(4,5,count/10000,2,0,0,0);
- 119 1 MB90092_DisChar(5,5,(count%10000)/1000,2,1,1,0);
- 120 1 MB90092_DisChar(6,5,(count%1000)/100,2,2,2,0);
- 121 1 MB90092_DisChar(7,5,(count%100)/10,2,3,3,0);
- 122 1 MB90092_DisChar(8,5,(count%10),2,4,4,0);
- 123 1 }
- 124
- 125 void DemoMoveText ()
- 126 {
- 127 1 UCHAR i,j,x,y,l;
- 128 1 static char x1=0x10;
- 129 1 static UCHAR color=0,color1=0;
- 130 1
- 131 1 MB90092_ClearRow (6);
- 132 1 MB90092_DisChar (0,2,0xAD,2,0,C_COLOR_RED,0);
- 133 1 MB90092_DisChar (1,2,0xAE,2,0,C_COLOR_RED,0);
- 134 1 MB90092_DisChar (2,2,':',2,0,C_COLOR_RED,0);
- 135 1
- 136 1 //文字移动
- 137 1 for (i=0;i<7;i++){
- 138 2 for (x=6+i,y=0;y<6;x--,y++){
- 139 3 //显示斜移的文字
- 140 3 MB90092_DisChar (x,y,0x1A0+i,2,color+1,color,0);
- 141 3 for (l=0;l<100;l++){
- 142 4 if (ScanKey ()) return;
- 143 4 Delay_ms (1);
- 144 4 }
- 145 3 //显示水平移动的文字
- 146 3 for (j=0;j<7;j++)
- 147 3 MB90092_DisChar (x1+j,8,0x1A0+j,2,0,color1++%7,0);
- 148 3 MB90092_ClearXY (x1+7,8);
- 149 3 if (x1<-8) x1=0x10;
- 150 3 else x1--;
- 151 3 color1=++color1%7;
- 152 3
- 153 3 MB90092_ClearXY (x,y);
- 154 3 MainLoop ();
- 155 3 }
- 156 2 MB90092_DisChar (x,y,0x1A0+i,2,color+1,color,0);
- 157 2 color=++color%6;
- 158 2 }
- 159 1 }
- 160
- 161
- 162 void DemoPicture ()
- 163 {
- 164 1 UCHAR l;
- 165 1 static UCHAR color=0;
- 166 1 //动画演示
- 167 1 MB90092_DisChar(0,2,0xB8,7,0,0,0);
- 168 1 MB90092_DisChar(1,2,0xB9,7,0,0,0);
- 169 1 MB90092_DisChar(2,2,':',7,0,0,0);
- 170 1
- 171 1 color=++color%7;
- 172 1 MB90092_DisChar(4,5,0x140,2,color,color,0);
- 173 1 MB90092_DisChar(7,5,0x143,2,color,color,0);
- 174 1
- 175 1 MB90092_DisChar(4,7,0x150,2,color,color,0);
- 176 1 MB90092_DisChar(7,7,0x153,2,color,color,0);
- 177 1
- 178 1 MB90092_DisChar(5,5,0x141,2,color,color,0);
- 179 1 MB90092_DisChar(6,5,0x142,2,color,color,0);
- C51 COMPILER V7.50 DEMO_FUNS 01/13/2010 18:22:38 PAGE 4
- 180 1 MB90092_DisChar(5,7,0x151,2,color,color,0);
- 181 1 MB90092_DisChar(6,7,0x152,2,color,color,0);
- 182 1
- 183 1 for (l=0;l<100;l++){
- 184 2 if (ScanKey ()) return;
- 185 2 Delay_ms (1);
- 186 2 }
- 187 1
- 188 1 MB90092_DisChar(5,5,0x144,2,color,color,0);
- 189 1 MB90092_DisChar(6,5,0x145,2,color,color,0);
- 190 1 MB90092_DisChar(5,7,0x154,2,color,color,0);
- 191 1 MB90092_DisChar(6,7,0x155,2,color,color,0);
- 192 1
- 193 1 for (l=0;l<100;l++){
- 194 2 if (ScanKey ()) return;
- 195 2 Delay_ms (1);
- 196 2 }
- 197 1
- 198 1 MB90092_DisChar(5,5,0x146,2,color,color,0);
- 199 1 MB90092_DisChar(6,5,0x147,2,color,color,0);
- 200 1 MB90092_DisChar(5,7,0x156,2,color,color,0);
- 201 1 MB90092_DisChar(6,7,0x157,2,color,color,0);
- 202 1
- 203 1 for (l=0;l<100;l++){
- 204 2 if (ScanKey ()) return;
- 205 2 Delay_ms (1);
- 206 2 }
- 207 1
- 208 1 MB90092_DisChar(5,5,0x144,2,color,color,0);
- 209 1 MB90092_DisChar(6,5,0x145,2,color,color,0);
- 210 1 MB90092_DisChar(5,7,0x154,2,color,color,0);
- 211 1 MB90092_DisChar(6,7,0x155,2,color,color,0);
- 212 1
- 213 1 for (l=0;l<100;l++){
- 214 2 if (ScanKey ()) return;
- 215 2 Delay_ms (1);
- 216 2 }
- 217 1 }
- 218
- 219 void DemoPic ()
- 220 {
- 221 1 //静态图画
- 222 1 MB90092_DisChar(0,4,0xAB,2,0,0,0);
- 223 1 MB90092_DisChar(1,4,0xAC,2,0,0,0);
- 224 1 MB90092_DisChar(2,4,':',2,0,0,0);
- 225 1
- 226 1 MB90092_DisChar(9,0,0x8b,2,2,2,0);
- 227 1 MB90092_DisChar(10,0,0x8c,2,2,2,0);
- 228 1 MB90092_DisChar(11,0,0x8d,2,2,2,0);
- 229 1
- 230 1 MB90092_DisChar(9,2,0x9b,2,2,2,0);
- 231 1 MB90092_DisChar(10,2,0x9c,2,2,2,0);
- 232 1 MB90092_DisChar(11,2,0x9d,2,2,2,0);
- 233 1
- 234 1 MB90092_DisChar(4,6,0x149,2,2,2,0);
- 235 1 MB90092_DisChar(5,6,0x14a,2,2,2,0);
- 236 1 MB90092_DisChar(6,6,0x14b,2,2,2,0);
- 237 1 MB90092_DisChar(7,6,0x14c,2,2,2,0);
- 238 1
- 239 1 MB90092_DisChar(4,8,0x159,2,2,2,0);
- 240 1 MB90092_DisChar(5,8,0x15a,2,2,2,0);
- 241 1 MB90092_DisChar(6,8,0x15b,2,2,2,0);
- C51 COMPILER V7.50 DEMO_FUNS 01/13/2010 18:22:38 PAGE 5
- 242 1 MB90092_DisChar(7,8,0x15c,2,2,2,0);
- 243 1 }
- MODULE INFORMATION: STATIC OVERLAYABLE
- CODE SIZE = 2937 ----
- CONSTANT SIZE = ---- ----
- XDATA SIZE = ---- ----
- PDATA SIZE = ---- ----
- DATA SIZE = 8 9
- IDATA SIZE = ---- ----
- BIT SIZE = ---- ----
- END OF MODULE INFORMATION.
- C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)