⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sram.lst

📁 指纹识别源代码,用于智能门紧,还有配合MF800卡使用
💻 LST
📖 第 1 页 / 共 5 页
字号:
C51 COMPILER V7.01  SRAM                                                                   03/08/2007 12:09:36 PAGE 1   


C51 COMPILER V7.01, COMPILATION OF MODULE SRAM
OBJECT MODULE PLACED IN sram.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE sram.c OPTIMIZE(7,SPEED) REGFILE(.\fingerPRJ.ORC) BROWSE FLOATFUZZY(0) NOAR
                    -EGS DEBUG OBJECTEXTEND CODE

stmt level    source

   1          #include "reg58.h"
   2          #include "intrins.h"
   3          #define _SRAM_C_
   4          #include "sram.h"
   5          
   6          #include "event.h"
   7          #include "define.h"
   8          #include "setup.h"
   9          #include "system.h"
  10          #include "user.h"
  11          
  12          #include "373.h"
  13          
  14          #define MAXFUNCTIONS    4
  15          
  16          /////////////////////////////////////////////////////////////////////////
  17          unsigned char ram_readp0(unsigned char posi)
  18          {
  19   1              unsigned char tempdata;
  20   1              SRAMA16=0;
  21   1              SRAMA17=0;
  22   1              SRAMA18=0;
  23   1      
  24   1              DATAPORT=posi;
  25   1              SEL573L=1;
  26   1              _nop_();
  27   1              SEL573L=0;
  28   1              
  29   1              DATAPORT=0;
  30   1              SEL573H=1;
  31   1              _nop_();
  32   1              SEL573H=0;
  33   1              
  34   1              DATAPORT=0XFF;
  35   1      
  36   1              SELK6=0;
  37   1              RD=0;
  38   1              _nop_();
  39   1              tempdata=DATAPORT;
  40   1              RD=1;
  41   1              SELK6=1;
  42   1              return tempdata;
  43   1      
  44   1      }
  45          /////////////////////////////////////////////////////////////////////////
  46          void ram_writep0(unsigned char posi,unsigned char writechar)
  47          {
  48   1              SRAMA16=0;
  49   1              SRAMA17=0;
  50   1              SRAMA18=0;
  51   1      
  52   1              DATAPORT=posi;
  53   1              SEL573L=1;
  54   1              _nop_();
C51 COMPILER V7.01  SRAM                                                                   03/08/2007 12:09:36 PAGE 2   

  55   1              SEL573L=0;
  56   1              
  57   1              DATAPORT=0;
  58   1              SEL573H=1;
  59   1              _nop_();
  60   1              SEL573H=0;
  61   1      
  62   1              DATAPORT=writechar;
  63   1              SELK6=0;
  64   1              WR=0;
  65   1              _nop_();
  66   1              WR=1;
  67   1              SELK6=1;
  68   1      }
  69          /////////////////////////////////////////////////////////////////////////
  70          unsigned char ram_read(unsigned short low16posi,unsigned char high3posi)
  71          {
  72   1              //unsigned char tempdata;
  73   1              //t/empdata=position>>8;
  74   1              unsigned char tempdata;
  75   1      
  76   1              SRAMA16=0;
  77   1              SRAMA17=0;
  78   1              SRAMA18=0;
  79   1              ACC=high3posi;
  80   1      
  81   1              if(ACC&1)SRAMA16=1;
  82   1              if(ACC&2)SRAMA17=1;
  83   1              if(ACC&4)SRAMA18=1;
  84   1              //if(high3posi&1)SRAMA16=1;
  85   1              //if(high3posi&2)SRAMA17=1;
  86   1              //if(high3posi&4)SRAMA18=1;
  87   1      
  88   1              //tempdata=position>>16;
  89   1              DATAPORT=low16posi;
  90   1              SEL573L=1;
  91   1              _nop_();
  92   1              SEL573L=0;
  93   1              
  94   1              DATAPORT=low16posi>>8;
  95   1              SEL573H=1;
  96   1              _nop_();
  97   1              SEL573H=0;
  98   1              
  99   1              DATAPORT=0XFF;
 100   1      
 101   1              SELK6=0;
 102   1              RD=0;
 103   1              _nop_();
 104   1              tempdata=DATAPORT;
 105   1              RD=1;
 106   1              SELK6=1;
 107   1              return tempdata;
 108   1      }
 109          /////////////////////////////////////////////////////////////////////////
 110          void ram_write(unsigned short low16posi,unsigned char high3posi,unsigned char writechar)
 111          {
 112   1              //unsigned char tempdata;
 113   1              SRAMA16=0;
 114   1              SRAMA17=0;
 115   1              SRAMA18=0;
 116   1      
C51 COMPILER V7.01  SRAM                                                                   03/08/2007 12:09:36 PAGE 3   

 117   1              ACC=high3posi;
 118   1      
 119   1              if(ACC&1)SRAMA16=1;
 120   1              if(ACC&2)SRAMA17=1;
 121   1              if(ACC&4)SRAMA18=1;
 122   1      
 123   1              //if(high3posi&1)SRAMA16=1;
 124   1              //if(high3posi&2)SRAMA17=1;
 125   1              //if(high3posi&4)SRAMA18=1;
 126   1      
 127   1              //tempdata=position>>16;
 128   1              DATAPORT=low16posi;
 129   1              SEL573L=1;
 130   1              _nop_();
 131   1              SEL573L=0;
 132   1              
 133   1              DATAPORT=low16posi>>8;
 134   1              SEL573H=1;
 135   1              _nop_();
 136   1              SEL573H=0;
 137   1      
 138   1              DATAPORT=writechar;
 139   1              SELK6=0;
 140   1              WR=0;
 141   1              _nop_();
 142   1              WR=1;
 143   1              SELK6=1;
 144   1              //WR=1;
 145   1      }
 146          /////////////////////////////////////////////////////////////////////////
 147          void ram_read16(unsigned char ramitem8,unsigned char ramitem16)
 148          {
 149   1      
 150   1              
 151   1      
 152   1              SRAMA16=0;
 153   1              SRAMA17=0;
 154   1              SRAMA18=0;
 155   1      
 156   1              ACC=ramitem16;
 157   1              if(ACC&0X10)SRAMA16=1;
 158   1              if(ACC&0X20)SRAMA17=1;
 159   1              if(ACC&0X40)SRAMA18=1;
 160   1      
 161   1              //if(ramitem16&0x10)SRAMA16=1;
 162   1              //if(ramitem16&0x20)SRAMA17=1;
 163   1              //if(ramitem16&0x40)SRAMA18=1;
 164   1      
 165   1      
 166   1              ramitem16=(ramitem16<<4)|(ramitem8>>4);
 167   1              ramitem8<<=4;
 168   1      
 169   1              DATAPORT=ramitem16;
 170   1              SEL573H=1;
 171   1              _nop_();
 172   1              SEL573H=0;
 173   1      
 174   1      
 175   1              //for(;(ramitem8&0xf)!=0xf;ramitem8++)
 176   1              //{
 177   1              do{
 178   2                      DATAPORT=ramitem8;
C51 COMPILER V7.01  SRAM                                                                   03/08/2007 12:09:36 PAGE 4   

 179   2                      SEL573L=1;
 180   2                      _nop_();
 181   2                      SEL573L=0;
 182   2              
 183   2                      DATAPORT=0XFF;
 184   2      
 185   2                      SELK6=0;
 186   2                      RD=0;
 187   2                      _nop_();
 188   2                      tempbuff[ramitem8&0xf]=DATAPORT;
 189   2                      RD=1;
 190   2                      SELK6=1;
 191   2                      ramitem8++;
 192   2              }while(ramitem8&0xf);
 193   1      }
 194          /////////////////////////////////////////////////////////////////////////
 195          //write data in tempbuff into sram
 196          void ram_write16(unsigned char ramitem8,unsigned char ramitem16)
 197          {
 198   1              
 199   1              SRAMA16=0;
 200   1              SRAMA17=0;
 201   1              SRAMA18=0;
 202   1      
 203   1      
 204   1              //if(ramitem16&0x10)SRAMA16=1;
 205   1              //if(ramitem16&0x20)SRAMA17=1;
 206   1              //if(ramitem16&0x40)SRAMA18=1;
 207   1              ACC=ramitem16;
 208   1              if(ACC&0X10)SRAMA16=1;
 209   1              if(ACC&0X20)SRAMA17=1;
 210   1              if(ACC&0X40)SRAMA18=1;
 211   1      
 212   1      
 213   1              ramitem16=(ramitem16<<4)|(ramitem8>>4);
 214   1              ramitem8<<=4;
 215   1      
 216   1              DATAPORT=ramitem16;
 217   1              SEL573H=1;
 218   1              _nop_();
 219   1              SEL573H=0;
 220   1      
 221   1              //for(;(ramitem8&0xf)!=0xf;ramitem8++)
 222   1              do
 223   1              {
 224   2                      DATAPORT=ramitem8;
 225   2                      SEL573L=1;
 226   2                      _nop_();
 227   2                      SEL573L=0;
 228   2              
 229   2      
 230   2                      DATAPORT=tempbuff[ramitem8&0xf];
 231   2                      SELK6=0;
 232   2                      WR=0;
 233   2                      _nop_();
 234   2                      WR=1;
 235   2                      SELK6=1;
 236   2                      ramitem8++;
 237   2              }while(ramitem8&0xf);
 238   1      }
 239          /////////////////////////////////////////////////////////////////////////
 240          //read 8 bytes' data in sram and copy to tempbuff
C51 COMPILER V7.01  SRAM                                                                   03/08/2007 12:09:36 PAGE 5   

 241          void ram_read8(unsigned char ramitem8,unsigned char ramitem16)
 242          {
 243   1      
 244   1      
 245   1              SRAMA16=0;
 246   1              SRAMA17=0;
 247   1              SRAMA18=0;
 248   1      
 249   1              ramitem16=(ramitem16<<3)|(ramitem8>>5);
 250   1              ramitem8<<=3;
 251   1      
 252   1              DATAPORT=ramitem16;
 253   1              SEL573H=1;
 254   1              _nop_();
 255   1              SEL573H=0;
 256   1      
 257   1              //for(;(ramitem8&0x7)!=0x7;ramitem8++)
 258   1              do
 259   1              {
 260   2                      DATAPORT=ramitem8;
 261   2                      SEL573L=1;
 262   2                      _nop_();
 263   2                      SEL573L=0;
 264   2              
 265   2                      DATAPORT=0XFF;
 266   2      
 267   2                      SELK6=0;
 268   2                      RD=0;
 269   2                      _nop_();
 270   2                      tempbuff[8+(ramitem8&0x7)]=DATAPORT;
 271   2                      RD=1;
 272   2                      SELK6=1;
 273   2                      ramitem8++;
 274   2              }while(ramitem8&0x7);
 275   1      }
 276          /////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -