思思久久96热在精品国产10-思思久久96热在精品国产免费-思思久久99-思思久久99热-一级毛片免费观看视频-一级毛片免费看

qxf0218
級(jí)別: 探索解密
精華主題: 0
發(fā)帖數(shù)量: 18 個(gè)
工控威望: 135 點(diǎn)
下載積分: 607 分
在線(xiàn)時(shí)間: 3(小時(shí))
注冊(cè)時(shí)間: 2014-03-24
最后登錄: 2016-07-11
查看qxf0218的 主題 / 回貼
樓主  發(fā)表于: 2014-07-01 11:01
西門(mén)子S7-300 BCC數(shù)據(jù)效驗(yàn)和             誰(shuí)有用過(guò)的程序?分享一份。謝謝
學(xué)無(wú)止境
zjiori
級(jí)別: 正式會(huì)員
精華主題: 0
發(fā)帖數(shù)量: 4 個(gè)
工控威望: 94 點(diǎn)
下載積分: 578 分
在線(xiàn)時(shí)間: 3(小時(shí))
注冊(cè)時(shí)間: 2014-12-09
最后登錄: 2014-12-31
查看zjiori的 主題 / 回貼
1樓  發(fā)表于: 2014-12-16 16:00
接口: IN: DB_NO  INT  DB number
           LEN    INT  Length of source area
       OUT:RETVAL INT  RETVAL
       TEMP:w_db_no  Word  DB number
            w_bcc_value  Word   actual BCC value
            w_temp_val   Word   temporary value
            d_loop_akt   DWord  actual value of the loop counter
            d_loop       DWord  loop counter

  L     #LEN                        // load length                  
      L     2                           // decrement length by 2
      -I                                // last 2 bytes are reserved for BCC
      SLD   3                           // calculate bit offset
      T     #d_loop                     // save the last bit address

      L     #DB_NO                      // load DB number
      T     #w_db_no
      OPN   DB [#w_db_no]               // and open DBs

      L     0
      T     #d_loop_akt                 // initialize loop counter
      T     #w_bcc_value                // initialize the BCC

// loop for calculating the BCC for (LEN - 2) bytes
// abort if d_loop_akt = d_loop

LOOP: L     DBB [#d_loop_akt]           // load byte from DB
      L     #w_bcc_value                // load actual BCC
      XOW                               // EXOR
      T     #w_bcc_value                // and save

      L     8                           // increment the bit address by 8
      L     #d_loop_akt                 // to address the next byte
      +D    
      T     #d_loop_akt

      L     #d_loop
      <I    
      JC    LOOP

// load the actual BCC
// and compare with the last two bytes of the source DB
// example: #LEN      22
//           0..19     data bytes
//           20,21     BCC-HI, BCC-LO

      L     #w_bcc_value                // load BCC
      AW    W#16#F0                     //separate the most significant nibble
      SLW   4                           // shift the least significant nibble to the highbyte
      OW    W#16#3000                   // OR 30h to Highbyte to receive ASCII character
      T     #w_temp_val                 // and save temporary

      L     #w_bcc_value                // load BCC
      AW    W#16#F                      //separate the least significant nibble
      OW    W#16#30                     // OR 30h to Lowbyte to receive ASCII character
      L     #w_temp_val
      OW    

      L     DBW [#d_loop_akt]           // Load BCC from DB
      ==I                               // and compare
      L     0                           // value of RETVAL, if comparison ok
      JC    ENDE

      L     -1                          // value of RETVAL, if comparison not ok
ENDE: T     #RETVAL

      BE    

主站蜘蛛池模板: 国产尤物二区三区在线观看 | 国产成人免费高清激情视频 | 九九九好热在线 | 男女男精品视频网站在线观看 | 国产一二区视频 | 国产视频h | 久久99九九精品免费 | 国产一级影院 | 国产白丝jk制服又刺激又舒服 | 美女一区二区在线观看 | 国产经典一区 | 久久国产精品免费专区 | 精品va卡卡1卡2卡3最新版 | 久操天堂 | 国产成人91一区二区三区 | 国产精品久久久久9999 | 国产美女流出白浆在线观看 | 国产精品久久久久久一级毛片 | 九一国产精品 | 韩国一区二区三区视频 | 福利姬在线观看 | 麻豆91精品91久久久 | 国产精品自产拍2021在线观看 | 麻豆91在线| 国产精品资源在线观看网站 | 国产成人高清精品免费软件 | 狠狠亚洲狠狠欧洲2019 | 国产视频综合 | 久久成人精品免费播放 | 国产精品久久久久久影院 | 成人在免费观看视频国产 | 国产v综合v亚洲欧美大另类 | 久久美女视频 | 国产成人精品免费视频大全软件 | 国产美女视频一区二区二三区 | 福利视频欧美 | 操 美女视频 免费网站 | 久久久久亚洲日日精品 | 国产在线精品一区二区不卡 | 国产欧美在线观看 | 精品国产第一国产综合精品gif |