?? word.lst
字號(hào):
C51 COMPILER V7.02b WORD 01/18/2005 19:37:31 PAGE 1
C51 COMPILER V7.02b, COMPILATION OF MODULE WORD
OBJECT MODULE PLACED IN word.OBJ
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE word.c LARGE BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include "word.h"
2
3 bit InterpretCommand(unsigned char *ComBuf,stWORDTABLE *WordTable)
4 {
5 1 int i=0; /*ComBuf String pointer*/
6 1 int j=0; /*Length of Word */
7 1 int k=-1; /*The number of WordTable*/
8 1 int StrFlag=0; /*There is "0-9/a-z/A-Z" before " ,()"*/
9 1 int SentenceEndFlag=0; /*Sentence end*/
10 1 char ch;
11 1
12 1 WordTable->Num=0;
13 1 WordTable->LeftCurveNum=0;//左括號(hào)
14 1 WordTable->RightCurveNum=0;//右括號(hào)
15 1
16 1 ch=ComBuf[0];
17 1 while(!SentenceEndFlag&&i<MaxLenComBuf)
18 1 {
19 2 if((ch>='0'&&ch<='9')||(ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')||(ch=='.'))
20 2 {
21 3 if(StrFlag==0)
22 3 {
23 4 StrFlag=1;k=k+1;j=0;
24 4 if(k>=MaxLenWordTable) return 0;
25 4 WordTable->wt[k].Str[j]=ch;
26 4 WordTable->Num=k+1;
27 4 }
28 3 else
29 3 {
30 4 j=j+1;
31 4 if(j>=MaxLenWord) return 0;
32 4 WordTable->wt[k].Str[j]=ch;
33 4 }
34 3 }
35 2 else if(ch==' '||ch==','||ch=='('||ch==')'||ch=='\0')
36 2 {
37 3 if(ch=='(')
38 3 WordTable->LeftCurveNum++;
39 3 if(ch==')')
40 3 WordTable->RightCurveNum++;
41 3 if(StrFlag==1)
42 3 {
43 4 StrFlag=0;j=j+1;
44 4 WordTable->wt[k].Str[j]='\0';
45 4 WordTable->wt[k].Length=j;
46 4 }
47 3 if(ch=='\0')
48 3 SentenceEndFlag=1;
49 3 }
50 2 else
51 2 {
52 3 return 0;
53 3 }
54 2 i=i+1;
55 2 ch=ComBuf[i];
C51 COMPILER V7.02b WORD 01/18/2005 19:37:31 PAGE 2
56 2 }
57 1 if(i<MaxLenComBuf||ComBuf[MaxLenComBuf]=='\0'){
58 2 if(WordTable->LeftCurveNum==WordTable->RightCurveNum) return 1;
59 2 else return 0;
60 2 }
61 1 else{
62 2 return 0;
63 2 }
64 1 }
65
66 void strlwr(unsigned char *str)//將字符串全部轉(zhuǎn)換成小寫(xiě)格式
67 {
68 1 int i;
69 1 unsigned char ch;
70 1
71 1 for(i=0;1;i++){
72 2 ch=*(str+i);
73 2 if(ch=='\0') break;
74 2 else if(ch>='A'&&ch<='Z') *(str+i)=ch-'A'+'a';
75 2 }
76 1 }
77 char strcmp(unsigned char *stra,unsigned char *strb)//比較a和b兩個(gè)字符串的大小,a>b 1 a=b 0 a<b -1
78 {
79 1 int i;
80 1 unsigned char cha,chb;
81 1 for(i=0;1;i++){
82 2 cha=*(stra+i);
83 2 chb=*(strb+i);
84 2 if(cha=='\0'&&chb=='\0')
85 2 return 0;
86 2 else if(cha>chb)
87 2 return 1;
88 2 else if(cha<chb)
89 2 return -1;
90 2 }
91 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 947 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 27
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -