HPI32.LST
上传用户:jcsy2001
上传日期:2013-11-29
资源大小:201k
文件大小:54k
开发平台:

C/C++

  1. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 1   
  2. C51 COMPILER V8.02, COMPILATION OF MODULE HPI32
  3. OBJECT MODULE PLACED IN HPI32.OBJ
  4. COMPILER INVOKED BY: D:KeilC51BINC51.EXE HPI32.C BROWSE DEBUG OBJECTEXTEND
  5. line level    source
  6.    1          #include "common.h"
  7.    2          #include "DEVICE.H"
  8.    3          #include "HPI.H"
  9.    4          #include "HAL.H"
  10.    5          #include "Fat.h"
  11.    6          #include "Fat32.h"
  12.    7          #include "HPI32.H"
  13.    8          
  14.    9          extern FLAGS bdata bFlags;
  15.   10          extern unsigned char xdata DBUF[BUFFER_LENGTH];
  16.   11          //////////////////////////////////////////
  17.   12          extern unsigned char xdata UARTBUF[UARTBUF_LENGTH];
  18.   13          extern SYS_INFO_BLOCK xdata DeviceInfo;
  19.   14          extern FILE_INFO xdata ThisFile;
  20.   15          
  21.   16          extern Command_Def xdata Command;
  22.   17          extern Response_Def xdata Response;
  23.   18          
  24.   19          unsigned long xdata DirStartCluster32,NowCluster32;
  25.   20          extern unsigned long xdata NowSector;
  26.   21          extern ShowFileName_Def xdata ShowFileName[MaxLFNum];   //long file struct
  27.   22          /////////////////////////////////////////////
  28.   23          
  29.   24          unsigned char UartHandler32(void)
  30.   25          {
  31.   26   1        Response.Result=0;Response.len=0;
  32.   27   1        switch(Command.CLass)
  33.   28   1        {
  34.   29   2          case 0x00:  //List          
  35.   30   2              Response.Result=List32();
  36.   31   2              break;  
  37.   32   2              case 0x01:      //Open File
  38.   33   2                      Response.Result=OpenFile32(Command.Parameter);          
  39.   34   2              break;
  40.   35   2              case 0x02:      //Read File             
  41.   36   2                      Response.Result=ReadFile32(Command.len,UARTBUF);
  42.   37   2                      break;   
  43.   38   2          case 0x03:  //Set Pointer
  44.   39   2                      Response.Result=SetFilePointer32(Command.len);  
  45.   40   2                      break;
  46.   41   2              case 0x04:      //Great File
  47.   42   2                      Response.Result=OpenFile32(Command.Parameter);
  48.   43   2                      if(Response.Result)
  49.   44   2                              {
  50.   45   3                              Response.Result=SetFilePointer32(ThisFile.LengthInByte);
  51.   46   3                              }
  52.   47   2                      else
  53.   48   2                      Response.Result=CreateFile32(Command.len,Command.Parameter,UARTBUF);            
  54.   49   2              break; 
  55.   50   2              case 0x05:      //Write File
  56.   51   2              Response.Result=WriteFile32(Command.len,UARTBUF);
  57.   52   2              break; 
  58.   53   2          case 0x06:  //Remove File
  59.   54   2              ThisFile.bFileOpen=0;   
  60.   55   2              Response.Result=RemoveFile32(Command.Parameter);
  61. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 2   
  62.   56   2              break;  
  63.   57   2              case 0x07:      //Get Space     
  64.   58   2              Response.Result=GetCapacity32();
  65.   59   2              break;     
  66.   60   2              case 0x08:  //DetectDisk
  67.   61   2                      if(bFlags.bits.SLAVE_IS_ATTACHED)
  68.   62   2                              Response.Result=1;
  69.   63   2                      break;
  70.   64   2              case 0x09:  //Great Dir
  71.   65   2                      Response.Result=DownDir32(Command.Parameter);
  72.   66   2                      if(!Response.Result)
  73.   67   2                              Response.Result=CreateDir32(Command.len,Command.Parameter,UARTBUF);     
  74.   68   2              break; 
  75.   69   2              case 0x0a:      //Down Dir
  76.   70   2                      Response.Result=DownDir32(Command.Parameter);
  77.   71   2                      break;
  78.   72   2              case 0x0b:      //Up Dir
  79.   73   2                      Response.Result=UpDir32();
  80.   74   2                      break;  
  81.   75   2              case 0x0c:      //Up RootDir
  82.   76   2                      Response.Result=UpRootDir32();
  83.   77   2                      break;  
  84.   78   2        }
  85.   79   1      
  86.   80   1        UartSendRsp();
  87.   81   1        ///////////////////////////////
  88.   82   1        return TRUE;  
  89.   83   1      }
  90.   84          
  91.   85          unsigned char List32(void)
  92.   86          {
  93.   87   1              unsigned int item,i;
  94.   88   1              unsigned char k,bstop,sector;
  95.   89   1              unsigned char Lcount,Ncount,base;
  96.   90   1              
  97.   91   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  98.   92   1                      return FALSE;                   
  99.   93   1              item=0;
  100.   94   1              bstop=0;
  101.   95   1              ////////////////////////////////////
  102.   96   1              Lcount=0;
  103.   97   1              for(i=0;i<MaxLFNum;i++)
  104.   98   1                      {
  105.   99   2                      ShowFileName[i].LongName[0]=0x00;
  106.  100   2                      ShowFileName[i].LongName[1]=0x00;
  107.  101   2                      }
  108.  102   1      //////////////////////////////////////////////////////////////////                      
  109.  103   1              NowCluster32=DirStartCluster32;         
  110.  104   1                      do
  111.  105   1                      {
  112.  106   2                              NowSector=FirstSectorofCluster32(NowCluster32);
  113.  107   2                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  114.  108   2                      {   
  115.  109   3                                      if(!SdReadSector(NowSector+sector,1,DBUF))
  116.  110   3                                              return FALSE;                           
  117.  111   3                                      for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  118.  112   3                                      {
  119.  113   4                                              if(DBUF[i]==0x00)
  120.  114   4                                                      {bstop=1;break;}
  121.  115   4                                              else if(DBUF[i]==0xE5)
  122.  116   4                                                      continue;                       
  123.  117   4                                              else
  124. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 3   
  125.  118   4                                              {
  126.  119   5                                                      for(k=0;k<32;k++)
  127.  120   5                                                              UARTBUF[item*32+k]=DBUF[i+k];
  128.  121   5                                                      item=item+1;
  129.  122   5                                               if(item>=(UARTBUF_LENGTH/32))  {bstop=1;break;}  //串口缓冲 只能有512项目录,强行结束
  130.  123   5                                                      /////////////////////////////////
  131.  124   5                                              if(Lcount<MaxLFNum)
  132.  125   5                                               {
  133.  126   6                                                      if(DBUF[i+11]==0x0F)
  134.  127   6                                                      {
  135.  128   7                                                              base=((DBUF[i]&0x1F)-1)*26;
  136.  129   7                                                              if(base<=224)
  137.  130   7                                                              {
  138.  131   8                                                                      Ncount=0;
  139.  132   8                                                                      for(k=1;k<11;k++)
  140.  133   8                                                                      {
  141.  134   9                                                                              ShowFileName[Lcount].LongName[base+Ncount]=DBUF[i+k];
  142.  135   9                                                                              Ncount++;
  143.  136   9                                                                      }
  144.  137   8                                                                      for(k=14;k<26;k++)
  145.  138   8                                                                      {
  146.  139   9                                                                              ShowFileName[Lcount].LongName[base+Ncount]=DBUF[i+k];
  147.  140   9                                                                              Ncount++;
  148.  141   9                                                                      }
  149.  142   8                                                                      for(k=28;k<32;k++)
  150.  143   8                                                                      {
  151.  144   9                                                                              ShowFileName[Lcount].LongName[base+Ncount]=DBUF[i+k];
  152.  145   9                                                                              Ncount++;
  153.  146   9                                                                      }
  154.  147   8                                                              }
  155.  148   7                                                      }
  156.  149   6                                                      else
  157.  150   6                                                      {
  158.  151   7                                                              for(k=0;k<32;k++)
  159.  152   7                                                                      ShowFileName[Lcount].item[k]=DBUF[i+k];
  160.  153   7                                                         Lcount++;                                                    
  161.  154   7                                                      }       
  162.  155   6                                            }
  163.  156   5                                      /////////////////////////////////
  164.  157   5                                              }
  165.  158   4                                      }
  166.  159   3                                      if(bstop==1)break;              
  167.  160   3                      }
  168.  161   2                              if(bstop==1)break;
  169.  162   2              
  170.  163   2                              NowCluster32=GetNextClusterNum32(NowCluster32); 
  171.  164   2                              
  172.  165   2                      }while(NowCluster32<=DeviceInfo.TotCluster);
  173.  166   1      
  174.  167   1              Response.len=item*32;
  175.  168   1              return TRUE;    
  176.  169   1      }
  177.  170          
  178.  171          unsigned char OpenFile32(unsigned char *pBuffer)
  179.  172          {
  180.  173   1              unsigned int i;
  181.  174   1              unsigned char j,bstop,sector;
  182.  175   1                      
  183.  176   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  184.  177   1                      return FALSE;                   
  185.  178   1              ThisFile.bFileOpen=0;
  186.  179   1              NowCluster32=DirStartCluster32;         
  187. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 4   
  188.  180   1                      do
  189.  181   1                      {
  190.  182   2                              NowSector=FirstSectorofCluster32(NowCluster32);
  191.  183   2                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  192.  184   2                      {   
  193.  185   3                                      if(!SdReadSector(NowSector+sector,1,DBUF))
  194.  186   3                                              return FALSE;                           
  195.  187   3                                      for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  196.  188   3                                      {
  197.  189   4                                              if(DBUF[i]==0x00)
  198.  190   4                                                      return FALSE;
  199.  191   4                                              j=0;
  200.  192   4                                              while(DBUF[i+j]==*(pBuffer+j))
  201.  193   4                                              {
  202.  194   5                                                       j=j+1;
  203.  195   5                                                       if(j>10)
  204.  196   5                                                              break;
  205.  197   5                                              }
  206.  198   4                                              if(j>10&&(DBUF[i+11]&0x10)!=0x10)
  207.  199   4                                              { 
  208.  200   5                                                      for(j=0;j<32;j++)
  209.  201   5                                                      UARTBUF[j]=DBUF[i+j];                       
  210.  202   5                                              bstop=1;
  211.  203   5                                              break;
  212.  204   5                                                      }
  213.  205   4                                      }
  214.  206   3                                      if(bstop==1)break;              
  215.  207   3                      }
  216.  208   2                              if(bstop==1)break;      
  217.  209   2                              NowCluster32=GetNextClusterNum32(NowCluster32);                 
  218.  210   2                      }while(NowCluster32<=DeviceInfo.TotCluster);
  219.  211   1                      
  220.  212   1              if(NowCluster32>DeviceInfo.TotCluster)
  221.  213   1                      return FALSE;
  222.  214   1      
  223.  215   1              ThisFile.bFileOpen=1;
  224.  216   1              ThisFile.StartCluster=LSwapINT32(UARTBUF[26],UARTBUF[27],UARTBUF[20],UARTBUF[21]);
  225.  217   1              ThisFile.LengthInByte=LSwapINT32(UARTBUF[28],UARTBUF[29],UARTBUF[30],UARTBUF[31]);
  226.  218   1              ThisFile.ClusterPointer=ThisFile.StartCluster;  
  227.  219   1              ThisFile.SectorPointer=FirstSectorofCluster32(ThisFile.StartCluster);
  228.  220   1              ThisFile.OffsetofSector=0;
  229.  221   1              ThisFile.SectorofCluster=0;     
  230.  222   1              ThisFile.FatSectorPointer=0;    
  231.  223   1              ThisFile.pointer=0;
  232.  224   1              
  233.  225   1              Response.len=32;
  234.  226   1              return TRUE;    
  235.  227   1      }
  236.  228          
  237.  229          
  238.  230          unsigned char ReadFile32(unsigned long readLength,unsigned char *pBuffer)
  239.  231          {
  240.  232   1      
  241.  233   1              unsigned int len,i;
  242.  234   1              unsigned int tlen;      
  243.  235   1              unsigned long blen;
  244.  236   1      
  245.  237   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  246.  238   1                      return FALSE;           
  247.  239   1              if(!ThisFile.bFileOpen)
  248.  240   1                      return FALSE;
  249.  241   1      
  250. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 5   
  251.  242   1              blen=readLength;
  252.  243   1              tlen=0;
  253.  244   1              if(readLength>MAX_READ_LENGTH)
  254.  245   1                      return FALSE;   
  255.  246   1              
  256.  247   1              if(readLength+ThisFile.pointer>ThisFile.LengthInByte)
  257.  248   1                      return FALSE;   
  258.  249   1                      
  259.  250   1              ////////////////////////////////////////////            
  260.  251   1                      while(readLength>0)
  261.  252   1                      {
  262.  253   2                         if(readLength+ThisFile.OffsetofSector>DeviceInfo.BPB_BytesPerSec)
  263.  254   2                              len=DeviceInfo.BPB_BytesPerSec;
  264.  255   2                         else
  265.  256   2                              len=readLength+ThisFile.OffsetofSector;
  266.  257   2                         
  267.  258   2                         //////////////////////////////////////////////////////
  268.  259   2                         if(ThisFile.OffsetofSector>0)
  269.  260   2                              {
  270.  261   3                              if(SdReadSector(ThisFile.SectorPointer,1,DBUF))
  271.  262   3                                      {
  272.  263   4                                      
  273.  264   4                                      len=len-ThisFile.OffsetofSector;
  274.  265   4                                      for(i=0;i<len;i++)
  275.  266   4                                              
  276.  267   4                                              *(pBuffer+i)=DBUF[ThisFile.OffsetofSector+i];
  277.  268   4                                      ThisFile.OffsetofSector=ThisFile.OffsetofSector+len;
  278.  269   4                                      }
  279.  270   3                              else
  280.  271   3                                      return FALSE;                           
  281.  272   3                              }
  282.  273   2                         else
  283.  274   2                              {
  284.  275   3                                      if(!SdReadSector(ThisFile.SectorPointer,1,pBuffer+tlen))
  285.  276   3                                                      return FALSE;   
  286.  277   3                                      ThisFile.OffsetofSector=len;
  287.  278   3                              }
  288.  279   2                         ////////////////////////////////////////////////////////////
  289.  280   2                         readLength-=len;
  290.  281   2                         tlen+=len;
  291.  282   2                        
  292.  283   2                         /////////////////////////////////////////////////////////
  293.  284   2                         if(ThisFile.OffsetofSector>DeviceInfo.BPB_BytesPerSec-1)
  294.  285   2                         {    
  295.  286   3                              ThisFile.OffsetofSector-=DeviceInfo.BPB_BytesPerSec;
  296.  287   3                              ThisFile.SectorofCluster+=1;
  297.  288   3                              if(ThisFile.SectorofCluster>DeviceInfo.BPB_SecPerClus-1)
  298.  289   3                              {
  299.  290   4                                      ThisFile.SectorofCluster=0;
  300.  291   4                                       ThisFile.ClusterPointer=GetNextClusterNum32(ThisFile.ClusterPointer);
  301.  292   4                                       if(ThisFile.ClusterPointer>DeviceInfo.TotCluster)
  302.  293   4                                                 return FALSE;                                                
  303.  294   4                                       ThisFile.SectorPointer=FirstSectorofCluster32(ThisFile.ClusterPointer);        
  304.  295   4                              }
  305.  296   3                              else
  306.  297   3                                      ThisFile.SectorPointer=ThisFile.SectorPointer+1;
  307.  298   3                          }
  308.  299   2                         //////////////////////////////////////////////////////////////////
  309.  300   2                      }//end while
  310.  301   1                      
  311.  302   1              ThisFile.bFileOpen=1;
  312.  303   1              ThisFile.pointer+=tlen;
  313. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 6   
  314.  304   1              //////////////////////////////////////////////
  315.  305   1              Response.len=blen;
  316.  306   1      
  317.  307   1              return TRUE;
  318.  308   1      }
  319.  309          
  320.  310          unsigned char SetFilePointer32(unsigned long pointer)
  321.  311          {
  322.  312   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  323.  313   1                      return FALSE;           
  324.  314   1              if(!ThisFile.bFileOpen)
  325.  315   1                      return FALSE;           
  326.  316   1              ///////////////////////////////////////////////////////////
  327.  317   1              ThisFile.pointer=pointer;
  328.  318   1              if(ThisFile.pointer>ThisFile.LengthInByte)
  329.  319   1                      return FALSE;   
  330.  320   1      
  331.  321   1              if(!GoToPointer32(ThisFile.pointer))
  332.  322   1              {
  333.  323   2              ThisFile.bFileOpen=0;
  334.  324   2              return FALSE;   
  335.  325   2              }
  336.  326   1              //////////////////////////////////////////////
  337.  327   1              return TRUE;
  338.  328   1      }
  339.  329          
  340.  330          unsigned char CreateFile32(unsigned long len,unsigned char *pBuffer,unsigned char *pName)
  341.  331          {
  342.  332   1              unsigned int sector,i,j,DirCount;
  343.  333   1              unsigned long cnum;
  344.  334   1              unsigned char xdata bstop,InByte,bwrite;
  345.  335   1              unsigned long ClusterPointer;
  346.  336   1              
  347.  337   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  348.  338   1                      return FALSE;
  349.  339   1              if((len%32)!=0)
  350.  340   1                      return FALSE;
  351.  341   1              if((len+32)>DeviceInfo.BPB_BytesPerSec)
  352.  342   1                      return FALSE;
  353.  343   1      
  354.  344   1              ThisFile.bFileOpen=0;   
  355.  345   1      
  356.  346   1              cnum=GetFreeCusterNum32();
  357.  347   1              if(cnum<0x02)
  358.  348   1                      return FALSE;   
  359.  349   1      
  360.  350   1              pBuffer[21]=(unsigned char)(cnum>>24);
  361.  351   1              pBuffer[20]=(unsigned char)(cnum>>16);
  362.  352   1              pBuffer[27]=(unsigned char)(cnum>>8);
  363.  353   1              pBuffer[26]=(unsigned char)(cnum);
  364.  354   1      
  365.  355   1              pBuffer[28]=0;pBuffer[29]=0;pBuffer[30]=0;pBuffer[31]=0;
  366.  356   1              bstop=0;
  367.  357   1      
  368.  358   1              NowCluster32=DirStartCluster32;         
  369.  359   1                      do
  370.  360   1                      {
  371.  361   2                              NowSector=FirstSectorofCluster32(NowCluster32);
  372.  362   2                              ClusterPointer=NowCluster32;
  373.  363   2                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  374.  364   2                      {   
  375.  365   3                                      if(!SdReadSector(NowSector+sector,1,DBUF))
  376. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 7   
  377.  366   3                                              return FALSE;
  378.  367   3                                      DirCount=0;bwrite=0;
  379.  368   3      
  380.  369   3                                      for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  381.  370   3                                      {
  382.  371   4                                      if(len==0)
  383.  372   4                                              {
  384.  373   5                                              if((DBUF[i]==0x00)||(DBUF[i]==0xE5))
  385.  374   5                                              {
  386.  375   6                                              for(j=0;j<32;j++)
  387.  376   6                                                      DBUF[i+j]=*(pBuffer+j);
  388.  377   6                                              if(!SdWriteSector(NowSector+sector,1,DBUF))
  389.  378   6                                                      return FALSE;                                   
  390.  379   6                                              bstop=1;
  391.  380   6                                              break;
  392.  381   6                                              }               
  393.  382   5                                              }
  394.  383   4                                      else
  395.  384   4                                      {
  396.  385   5                                      if(DirCount==0)
  397.  386   5                                              InByte=i;
  398.  387   5                                      if(DBUF[i]==0xE5)                               
  399.  388   5                                              DirCount++;                             
  400.  389   5                                      else if(DBUF[i]==0x00)
  401.  390   5                                              {       
  402.  391   6                                              DirCount++;     
  403.  392   6                                              DBUF[i]=0xE5;   
  404.  393   6                                              bwrite=1;                               
  405.  394   6                                              }
  406.  395   5                                      else
  407.  396   5                                              DirCount=0;
  408.  397   5      
  409.  398   5                                      if((DirCount*32)>=(len+32))
  410.  399   5                                              {
  411.  400   6                                              for(j=0;j<len;j++)
  412.  401   6                                                      DBUF[InByte+j]=*(pName+j);
  413.  402   6                                              for(j=0;j<32;j++)
  414.  403   6                                                      DBUF[InByte+len+j]=*(pBuffer+j);
  415.  404   6                                              if(!SdWriteSector(NowSector+sector,1,DBUF))
  416.  405   6                                                      return FALSE;                                   
  417.  406   6                                              bstop=1;
  418.  407   6                                              break;
  419.  408   6                                              }
  420.  409   5                                       }
  421.  410   4                                      }
  422.  411   3                                      if(bstop==1)break;
  423.  412   3                                      
  424.  413   3                                      if((len!=0)&&(bwrite==1))
  425.  414   3                                      {
  426.  415   4                                      if(!SdWriteSector(NowSector+sector,1,DBUF))
  427.  416   4                                              return FALSE;
  428.  417   4                              }
  429.  418   3                      }
  430.  419   2                              if(bstop==1)break;
  431.  420   2              
  432.  421   2                              NowCluster32=GetNextClusterNum32(NowCluster32);
  433.  422   2                              if(NowCluster32>DeviceInfo.TotCluster)
  434.  423   2                      {
  435.  424   3                              NowCluster32=CreateClusterLink32(ClusterPointer);
  436.  425   3                              if(NowCluster32==0x00)
  437.  426   3                                       return FALSE;
  438.  427   3                              NowSector=FirstSectorofCluster32(NowCluster32);
  439. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 8   
  440.  428   3                              for(i=0;i<DeviceInfo.BPB_BytesPerSec;i++) DBUF[i]=0x00;
  441.  429   3                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  442.  430   3                                      {
  443.  431   4                                      if(!SdWriteSector(NowSector+sector,1,DBUF))
  444.  432   4                                              return FALSE;
  445.  433   4                                      }
  446.  434   3                              }
  447.  435   2                      }while(NowCluster32<=DeviceInfo.TotCluster);    
  448.  436   1      ////////////////////////////////////////////////////////////////
  449.  437   1              
  450.  438   1              ThisFile.StartCluster=cnum;
  451.  439   1              ThisFile.LengthInByte=0;
  452.  440   1              ThisFile.ClusterPointer=ThisFile.StartCluster;
  453.  441   1              ThisFile.SectorPointer=FirstSectorofCluster32(ThisFile.StartCluster);
  454.  442   1              ThisFile.OffsetofSector=0;
  455.  443   1              ThisFile.SectorofCluster=0;
  456.  444   1              ThisFile.bFileOpen=1;
  457.  445   1              ThisFile.pointer=0;
  458.  446   1              ThisFile.FatSectorPointer=0;
  459.  447   1              
  460.  448   1              return TRUE;
  461.  449   1      }
  462.  450          
  463.  451          
  464.  452          unsigned char WriteFile32(unsigned long writeLength,unsigned char *pBuffer)
  465.  453          {
  466.  454   1          unsigned long cnum;
  467.  455   1              unsigned int  len,sector,i,tlen;
  468.  456   1              unsigned char bSuccess,bStop;
  469.  457   1              
  470.  458   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  471.  459   1                      return FALSE;           
  472.  460   1              if(!ThisFile.bFileOpen)
  473.  461   1                      return FALSE;
  474.  462   1              ThisFile.bFileOpen=0;
  475.  463   1              bSuccess=1;
  476.  464   1              bStop=0;
  477.  465   1              tlen=0;
  478.  466   1      
  479.  467   1              while(writeLength>0)
  480.  468   1              {
  481.  469   2                      if(writeLength+ThisFile.OffsetofSector>DeviceInfo.BPB_BytesPerSec)
  482.  470   2                              len=DeviceInfo.BPB_BytesPerSec;
  483.  471   2                      else
  484.  472   2                              len=writeLength+ThisFile.OffsetofSector;
  485.  473   2                         
  486.  474   2                       //////////////////////////////////////////////////////
  487.  475   2                       if(ThisFile.OffsetofSector>0)
  488.  476   2                              {
  489.  477   3                              if(SdReadSector(ThisFile.SectorPointer,1,DBUF))
  490.  478   3                                      {
  491.  479   4                                      
  492.  480   4                                      len=len-ThisFile.OffsetofSector;
  493.  481   4                                      for(i=0;i<len;i++)                                      
  494.  482   4                                              DBUF[ThisFile.OffsetofSector+i]=*(pBuffer+i);
  495.  483   4                                      if(!SdWriteSector(ThisFile.SectorPointer,1,DBUF))
  496.  484   4                                              return FALSE;                                           
  497.  485   4                                      ThisFile.OffsetofSector=ThisFile.OffsetofSector+len;
  498.  486   4                                      }
  499.  487   3                              else
  500.  488   3                                      return FALSE;                           
  501.  489   3                              }
  502. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 9   
  503.  490   2                       else
  504.  491   2                              {
  505.  492   3                              if(!SdWriteSector(ThisFile.SectorPointer,1,pBuffer+tlen))
  506.  493   3                                      return FALSE;                           
  507.  494   3                              ThisFile.OffsetofSector=len;
  508.  495   3                              }
  509.  496   2                       /////////////////////////////////////////////////////
  510.  497   2                         writeLength-=len;
  511.  498   2                         tlen+=len;
  512.  499   2                       /////////////更新文件指针 //////////////////////////////
  513.  500   2                        if(ThisFile.OffsetofSector>DeviceInfo.BPB_BytesPerSec-1)
  514.  501   2                         {    
  515.  502   3                              ThisFile.OffsetofSector-=DeviceInfo.BPB_BytesPerSec;
  516.  503   3                              ThisFile.SectorofCluster+=1;
  517.  504   3                              if(ThisFile.SectorofCluster>DeviceInfo.BPB_SecPerClus-1)
  518.  505   3                              {
  519.  506   4                                      ThisFile.SectorofCluster=0;
  520.  507   4                                       ThisFile.ClusterPointer=CreateClusterLink32(ThisFile.ClusterPointer);
  521.  508   4                                       if(ThisFile.ClusterPointer==0x00)
  522.  509   4                                              return FALSE;                           
  523.  510   4                                       ThisFile.SectorPointer=FirstSectorofCluster32(ThisFile.ClusterPointer);        
  524.  511   4                              }
  525.  512   3                              else
  526.  513   3                                      ThisFile.SectorPointer=ThisFile.SectorPointer+1;
  527.  514   3                          }
  528.  515   2                      
  529.  516   2              
  530.  517   2              }//end while
  531.  518   1              ThisFile.pointer+=tlen;
  532.  519   1              ///////////更新文件目录信息/////////////////////////////
  533.  520   1              if(bSuccess==1)
  534.  521   1              {
  535.  522   2                      NowCluster32=DirStartCluster32;         
  536.  523   2                              do
  537.  524   2                              {
  538.  525   3                                      NowSector=FirstSectorofCluster32(NowCluster32);
  539.  526   3                                      for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  540.  527   3                                      {   
  541.  528   4                                              if(!SdReadSector(NowSector+sector,1,DBUF))
  542.  529   4                                                      return FALSE;                           
  543.  530   4                                              for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  544.  531   4                                              {
  545.  532   5                                                      cnum=LSwapINT32(DBUF[i+26],DBUF[i+27],DBUF[i+20],DBUF[i+21]);
  546.  533   5                                                      if((cnum==ThisFile.StartCluster)&&(DBUF[i]!=0xe5))
  547.  534   5                                                              {
  548.  535   6                                                              if(ThisFile.pointer>ThisFile.LengthInByte)
  549.  536   6                                                                      ThisFile.LengthInByte=ThisFile.pointer;                         
  550.  537   6                                                              DBUF[i+28]=(unsigned char)(ThisFile.LengthInByte&0xff);
  551.  538   6                                                              DBUF[i+29]=(unsigned char)((ThisFile.LengthInByte>>8)&0xff);
  552.  539   6                                                              DBUF[i+30]=(unsigned char)((ThisFile.LengthInByte>>16)&0xff);
  553.  540   6                                                              DBUF[i+31]=(unsigned char)((ThisFile.LengthInByte>>24)&0xff);
  554.  541   6                                                              if(!SdWriteSector(NowSector+sector,1,DBUF))
  555.  542   6                                                                      return FALSE;                   
  556.  543   6                                                               bStop=1;
  557.  544   6                                                               break;
  558.  545   6                                                              }                                                       
  559.  546   5                                      }
  560.  547   4                                              if(bStop==1)break;
  561.  548   4                                      }
  562.  549   3                                      if(bStop==1)break;
  563.  550   3                                      NowCluster32=GetNextClusterNum32(NowCluster32);                 
  564.  551   3                              }while(NowCluster32<=DeviceInfo.TotCluster);
  565. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 10  
  566.  552   2                      
  567.  553   2                      if(NowCluster32>DeviceInfo.TotCluster)
  568.  554   2                      return FALSE;           
  569.  555   2              }
  570.  556   1              
  571.  557   1              ThisFile.bFileOpen=1;
  572.  558   1              //////////////////////////////////////////////
  573.  559   1              return TRUE;
  574.  560   1      }
  575.  561          
  576.  562          
  577.  563          unsigned char RemoveFile32(unsigned char *pBuffer)
  578.  564          {
  579.  565   1              unsigned int sector,i;
  580.  566   1              unsigned char bStop,j;
  581.  567   1              int k;
  582.  568   1                      
  583.  569   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  584.  570   1                      return FALSE;
  585.  571   1      ////////////// 清除目录/////////////////////////////////////            
  586.  572   1              NowCluster32=DirStartCluster32;         
  587.  573   1                      do
  588.  574   1                      {
  589.  575   2                              NowSector=FirstSectorofCluster32(NowCluster32);
  590.  576   2                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  591.  577   2                      {   
  592.  578   3                                      if(!SdReadSector(NowSector+sector,1,DBUF))
  593.  579   3                                              return FALSE;                           
  594.  580   3                                      for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  595.  581   3                                      {
  596.  582   4                                              if(DBUF[i]==0x00)
  597.  583   4                                                      return FALSE;
  598.  584   4                                              j=0;
  599.  585   4                                              while(DBUF[i+j]==*(pBuffer+j))
  600.  586   4                                              {
  601.  587   5                                                       j=j+1;
  602.  588   5                                                       if(j>10)
  603.  589   5                                                              break;
  604.  590   5                                              }
  605.  591   4                                              if(j>10)
  606.  592   4                                              { 
  607.  593   5                                                      DBUF[i]=0xE5;
  608.  594   5                                                      ThisFile.StartCluster=LSwapINT32(DBUF[i+26],DBUF[i+27],DBUF[i+20],DBUF[i+21]);
  609.  595   5                                                      for(k=(i-32);k>=0;k=k-32)
  610.  596   5                                                      {
  611.  597   6                                                      if(DBUF[k+11]==0x0F)
  612.  598   6                                                              DBUF[k]=0xE5;
  613.  599   6                                                      else
  614.  600   6                                                              break;
  615.  601   6                                                      }
  616.  602   5                                                      DelayMs(15);
  617.  603   5                                                      if(!SdWriteSector(NowSector+sector,1,DBUF))
  618.  604   5                                                              return FALSE;                                   
  619.  605   5                                      //////////////////// 清除FAT中的纪录////////////////////////
  620.  606   5                                                      DelayMs(10);
  621.  607   5                                                      if(!DeleteClusterLink32(ThisFile.StartCluster))
  622.  608   5                                                              return FALSE;                                   
  623.  609   5                                                      bStop=1;
  624.  610   5                                                      break;
  625.  611   5                                                      }
  626.  612   4                                      }
  627.  613   3                                      if(bStop==1)break;              
  628. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 11  
  629.  614   3                      }
  630.  615   2                              if(bStop==1)break;      
  631.  616   2                              NowCluster32=GetNextClusterNum32(NowCluster32);                 
  632.  617   2                      }while(NowCluster32<=DeviceInfo.TotCluster);    
  633.  618   1              
  634.  619   1              if(NowCluster32>DeviceInfo.TotCluster)
  635.  620   1                  return FALSE;
  636.  621   1              
  637.  622   1              return TRUE;
  638.  623   1      }
  639.  624          
  640.  625          
  641.  626          unsigned char GetCapacity32(void)
  642.  627          {
  643.  628   1              unsigned int sectorNum,i;       
  644.  629   1              unsigned long FreeSize,Freesectorcnt;
  645.  630   1      
  646.  631   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  647.  632   1                      return FALSE;
  648.  633   1                      
  649.  634   1              ////////////////////////////////////////////////////////////////////////
  650.  635   1              sectorNum=DeviceInfo.FatStartSector;
  651.  636   1              Freesectorcnt=0;
  652.  637   1              while(sectorNum<DeviceInfo.BPB_FATSz32+DeviceInfo.FatStartSector)
  653.  638   1              {
  654.  639   2                      
  655.  640   2                      if(SdReadSector(sectorNum,1,DBUF))
  656.  641   2                      {
  657.  642   3                        for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+4)
  658.  643   3                              {                        
  659.  644   4                               if((DBUF[i]||DBUF[i+1]||DBUF[i+2]||DBUF[i+3])==0x00)
  660.  645   4                                      {       
  661.  646   5                                      Freesectorcnt++;
  662.  647   5                                      }         
  663.  648   4                              }       
  664.  649   3                      }
  665.  650   2                      else                    
  666.  651   2                              return FALSE;                   
  667.  652   2                      sectorNum++;
  668.  653   2              }
  669.  654   1              
  670.  655   1              ////////////////////////////////////////////////////////////////////////
  671.  656   1              FreeSize=DeviceInfo.BPB_BytesPerSec*DeviceInfo.BPB_SecPerClus;
  672.  657   1              FreeSize=Freesectorcnt*FreeSize;
  673.  658   1              
  674.  659   1              UARTBUF[0]=(unsigned char)((FreeSize>>24)&0xff);
  675.  660   1              UARTBUF[1]=(unsigned char)((FreeSize>>16)&0xff);
  676.  661   1              UARTBUF[2]=(unsigned char)((FreeSize>>8)&0xff);
  677.  662   1              UARTBUF[3]=(unsigned char)(FreeSize&0xff);
  678.  663   1              Response.len=4;
  679.  664   1              return TRUE;
  680.  665   1      }
  681.  666          
  682.  667          
  683.  668          unsigned char CreateDir32(unsigned long len,unsigned char *pBuffer,unsigned char *pName)
  684.  669          {
  685.  670   1              unsigned int sector,i,j,DirCount;
  686.  671   1              unsigned long cnum;
  687.  672   1              unsigned char xdata bstop,InByte,bwrite;
  688.  673   1              unsigned long ClusterPointer;
  689.  674   1              
  690.  675   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  691. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 12  
  692.  676   1                      return FALSE;
  693.  677   1              if((len%32)!=0)
  694.  678   1                      return FALSE;
  695.  679   1              if((len+32)>DeviceInfo.BPB_BytesPerSec)
  696.  680   1                      return FALSE;
  697.  681   1      
  698.  682   1              ThisFile.bFileOpen=0;
  699.  683   1              ThisFile.FatSectorPointer=0;
  700.  684   1      
  701.  685   1              cnum=GetFreeCusterNum32();
  702.  686   1              if(cnum<0x02)
  703.  687   1                      return FALSE;   
  704.  688   1              
  705.  689   1              pBuffer[11]=0x10;
  706.  690   1              pBuffer[21]=(unsigned char)(cnum>>24);
  707.  691   1              pBuffer[20]=(unsigned char)(cnum>>16);
  708.  692   1              pBuffer[27]=(unsigned char)(cnum>>8);
  709.  693   1              pBuffer[26]=(unsigned char)(cnum);
  710.  694   1              pBuffer[28]=0;pBuffer[29]=0;pBuffer[30]=0;pBuffer[31]=0;
  711.  695   1              bstop=0;
  712.  696   1      
  713.  697   1              NowCluster32=DirStartCluster32;         
  714.  698   1                      do
  715.  699   1                      {
  716.  700   2                              NowSector=FirstSectorofCluster32(NowCluster32);
  717.  701   2                              ClusterPointer=NowCluster32;
  718.  702   2                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  719.  703   2                      {   
  720.  704   3                                      if(!SdReadSector(NowSector+sector,1,DBUF))
  721.  705   3                                              return FALSE;
  722.  706   3                                      DirCount=0;bwrite=0;
  723.  707   3                                      for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  724.  708   3                                      {
  725.  709   4                                      if(len==0)
  726.  710   4                                              {
  727.  711   5                                              if((DBUF[i]==0x00)||(DBUF[i]==0xE5))
  728.  712   5                                              {
  729.  713   6                                              for(j=0;j<32;j++)
  730.  714   6                                                      DBUF[i+j]=*(pBuffer+j);
  731.  715   6                                              if(!SdWriteSector(NowSector+sector,1,DBUF))
  732.  716   6                                                      return FALSE;                                   
  733.  717   6                                              bstop=1;
  734.  718   6                                              break;
  735.  719   6                                              }               
  736.  720   5                                              }
  737.  721   4                                      else
  738.  722   4                                      {
  739.  723   5                                      if(DirCount==0)
  740.  724   5                                              InByte=i;
  741.  725   5                                      if(DBUF[i]==0xE5)                               
  742.  726   5                                              DirCount++;                             
  743.  727   5                                      else if(DBUF[i]==0x00)
  744.  728   5                                              {       
  745.  729   6                                              DirCount++;     
  746.  730   6                                              DBUF[i]=0xE5;
  747.  731   6                                              bwrite=1;                                       
  748.  732   6                                              }
  749.  733   5                                      else
  750.  734   5                                              DirCount=0;
  751.  735   5      
  752.  736   5                                      if((DirCount*32)>=(len+32))
  753.  737   5                                              {
  754. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 13  
  755.  738   6                                              for(j=0;j<len;j++)
  756.  739   6                                                      DBUF[InByte+j]=*(pName+j);
  757.  740   6                                              for(j=0;j<32;j++)
  758.  741   6                                                      DBUF[InByte+len+j]=*(pBuffer+j);
  759.  742   6                                              if(!SdWriteSector(NowSector+sector,1,DBUF))
  760.  743   6                                                      return FALSE;                                   
  761.  744   6                                              bstop=1;
  762.  745   6                                              break;
  763.  746   6                                              }
  764.  747   5                                       }                      
  765.  748   4                                      }
  766.  749   3                                      if(bstop==1)break;
  767.  750   3                                      if((len!=0)&&(bwrite==1))
  768.  751   3                                      {
  769.  752   4                                      if(!SdWriteSector(NowSector+sector,1,DBUF))
  770.  753   4                                              return FALSE;
  771.  754   4                              }
  772.  755   3                      }
  773.  756   2                              if(bstop==1)break;
  774.  757   2              
  775.  758   2                              NowCluster32=GetNextClusterNum32(NowCluster32);
  776.  759   2                              if(NowCluster32>DeviceInfo.TotCluster)
  777.  760   2                      {
  778.  761   3                              NowCluster32=CreateClusterLink32(ClusterPointer);
  779.  762   3                              if(NowCluster32==0x00)
  780.  763   3                                       return FALSE;
  781.  764   3                              NowSector=FirstSectorofCluster32(NowCluster32);
  782.  765   3                              for(i=0;i<DeviceInfo.BPB_BytesPerSec;i++) DBUF[i]=0x00;
  783.  766   3                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  784.  767   3                                      {
  785.  768   4                                      if(!SdWriteSector(NowSector+sector,1,DBUF))
  786.  769   4                                              return FALSE;
  787.  770   4                                      }
  788.  771   3                              }
  789.  772   2                      }while(NowCluster32<=DeviceInfo.TotCluster);
  790.  773   1              
  791.  774   1              if(NowCluster32>DeviceInfo.TotCluster)
  792.  775   1                  return FALSE;
  793.  776   1      ////////////////////////////////////////////////////////////////
  794.  777   1              for(i=64;i<DeviceInfo.BPB_BytesPerSec;i++)      DBUF[i]=0x00;
  795.  778   1              
  796.  779   1              for(i=0;i<43;i++) DBUF[i]=0x20;
  797.  780   1              
  798.  781   1              DBUF[0]=0x2e;
  799.  782   1              for(i=11;i<32;i++) DBUF[i]=pBuffer[i];
  800.  783   1      
  801.  784   1              DBUF[32]=0x2e;DBUF[33]=0x2e;
  802.  785   1              for(i=43;i<64;i++) DBUF[i]=pBuffer[i-32];
  803.  786   1      
  804.  787   1              if(DirStartCluster32==DeviceInfo.RootStartCluster)      //Root Dir
  805.  788   1                      {
  806.  789   2                      DBUF[53]=0;DBUF[52]=0;DBUF[59]=0;DBUF[58]=0;
  807.  790   2                      }
  808.  791   1              else
  809.  792   1                      {
  810.  793   2                      DBUF[53]=(unsigned char)(DirStartCluster32>>24);
  811.  794   2                      DBUF[52]=(unsigned char)(DirStartCluster32>>16);
  812.  795   2                      DBUF[59]=(unsigned char)(DirStartCluster32>>8);
  813.  796   2                      DBUF[58]=(unsigned char)(DirStartCluster32);
  814.  797   2                      }
  815.  798   1      
  816.  799   1              NowSector=FirstSectorofCluster32(cnum);
  817. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 14  
  818.  800   1              if(!SdWriteSector(NowSector,1,DBUF))
  819.  801   1                      return FALSE;   
  820.  802   1      
  821.  803   1              DirStartCluster32=cnum;
  822.  804   1      //      ThisFile.ClusterPointer=DirStartCluster32;
  823.  805   1              ThisFile.ClusterPointer=0;              
  824.  806   1              return TRUE;    
  825.  807   1      }
  826.  808          
  827.  809          unsigned char DownDir32(unsigned char *pBuffer)
  828.  810          {
  829.  811   1              unsigned int i;
  830.  812   1              unsigned char j,bstop,sector;   
  831.  813   1                      
  832.  814   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  833.  815   1                      return FALSE;   
  834.  816   1              
  835.  817   1              ThisFile.bFileOpen=0;
  836.  818   1              bstop=0;
  837.  819   1      
  838.  820   1              NowCluster32=DirStartCluster32;         
  839.  821   1                      do
  840.  822   1                      {
  841.  823   2                              NowSector=FirstSectorofCluster32(NowCluster32);
  842.  824   2                              for(sector=0;sector<DeviceInfo.BPB_SecPerClus;sector++)
  843.  825   2                      {   
  844.  826   3                                      if(!SdReadSector(NowSector+sector,1,DBUF))
  845.  827   3                                              return FALSE;                           
  846.  828   3                                      for(i=0;i<DeviceInfo.BPB_BytesPerSec;i=i+32)
  847.  829   3                                      {
  848.  830   4                                              if(DBUF[i]==0x00)
  849.  831   4                                                      return FALSE;
  850.  832   4                                              j=0;
  851.  833   4                                              while(DBUF[i+j]==*(pBuffer+j))
  852.  834   4                                              {
  853.  835   5                                                       j=j+1;
  854.  836   5                                                       if(j>10)
  855.  837   5                                                              break;
  856.  838   5                                              }
  857.  839   4                                              if(j>10&&(DBUF[i+11]&0x10))
  858.  840   4                                              {bstop=1;break;}
  859.  841   4                                      }
  860.  842   3                                      if(bstop==1)break;              
  861.  843   3                      }
  862.  844   2                              if(bstop==1)break;      
  863.  845   2                              NowCluster32=GetNextClusterNum32(NowCluster32);                 
  864.  846   2                      }while(NowCluster32<=DeviceInfo.TotCluster);
  865.  847   1                      
  866.  848   1              if(NowCluster32>DeviceInfo.TotCluster)
  867.  849   1                      return FALSE;
  868.  850   1      
  869.  851   1              DirStartCluster32=LSwapINT32(DBUF[i+26],DBUF[i+27],DBUF[i+20],DBUF[i+21]);      
  870.  852   1      //      ThisFile.ClusterPointer=DirStartCluster32;
  871.  853   1              ThisFile.ClusterPointer=0;              
  872.  854   1              return TRUE;
  873.  855   1      }
  874.  856          
  875.  857          unsigned char UpDir32()
  876.  858          {
  877.  859   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  878.  860   1                      return FALSE;   
  879.  861   1              if(DirStartCluster32==DeviceInfo.RootStartCluster)      //Root Dir
  880. C51 COMPILER V8.02   HPI32                                                                 04/29/2007 12:48:53 PAGE 15  
  881.  862   1                      return TRUE;    
  882.  863   1              
  883.  864   1              ThisFile.bFileOpen=0;
  884.  865   1      
  885.  866   1              NowSector=FirstSectorofCluster32(DirStartCluster32);
  886.  867   1              if(!SdReadSector(NowSector,1,DBUF))
  887.  868   1                              return FALSE;
  888.  869   1              if(DBUF[32]!=0x2e&&DBUF[33]!=0x2e)      //..
  889.  870   1                              return FALSE;
  890.  871   1      
  891.  872   1              DirStartCluster32=LSwapINT32(DBUF[58],DBUF[59],DBUF[52],DBUF[53]);
  892.  873   1              if(DirStartCluster32==0)        //Root Dir
  893.  874   1                      DirStartCluster32=DeviceInfo.RootStartCluster;  
  894.  875   1      //      ThisFile.ClusterPointer=DirStartCluster32;
  895.  876   1              ThisFile.ClusterPointer=0;              
  896.  877   1              return TRUE;
  897.  878   1      }
  898.  879          
  899.  880          unsigned char UpRootDir32()
  900.  881          {
  901.  882   1              if(!bFlags.bits.SLAVE_IS_ATTACHED)
  902.  883   1                      return FALSE;
  903.  884   1      
  904.  885   1              ThisFile.bFileOpen=0;
  905.  886   1              DirStartCluster32=DeviceInfo.RootStartCluster;  //Root Dir
  906.  887   1                              
  907.  888   1              return TRUE;
  908.  889   1      }
  909.  890          
  910. MODULE INFORMATION:   STATIC OVERLAYABLE
  911.    CODE SIZE        =   8682    ----
  912.    CONSTANT SIZE    =   ----    ----
  913.    XDATA SIZE       =      8       6
  914.    PDATA SIZE       =   ----    ----
  915.    DATA SIZE        =   ----     136
  916.    IDATA SIZE       =   ----    ----
  917.    BIT SIZE         =   ----    ----
  918. END OF MODULE INFORMATION.
  919. C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)