以前一同事(论坛里叫苏菲)写的!参考下
$1100 = FFFFH
$10000 = 2000
FOR $100
$1100 = $1100^*$10000
FOR 8
$4000.0 = GETB($1100.0)
$4001 = $1100>>1
IF $4000.0 == OFF
$1100 = $4001
ELSE
$1100 = $4001 ^ A001H
ENDIF
NEXT
$10000 = $10000 + 1
NEXT
$102 = $100 + 2
SWAP($1200, $1100, 1)
*$10000 = $1200/256
$10000 = $10000+1
*$10000 = $1200%256
$1210 = H2A($1200)
$1300 = $1211*256
$1302 = $1210 + $1300
$1301 = $1213*256
$1303 = $1212 + $1301
$10004 = 1400 +$100
BMOV($1400,$1000,$100)
BMOV(*$10004,$1302,2)
#$500 内存放CRC校验字
$500=0FFFFH
$511=0A001H
#需要计算的数据,依次存放在$501--$506
#第一字节校验
$510=$501
$500=$500^$510
FOR 8
#循环右移1位
$509.0=GETB $500.0
$500=$500>>1
$500.15=GETB $509.0
IF $500<8000H THEN GOTO LABEL 10
$500=$500-8000H
$500=$500^$511
LABEL 10
NEXT
#第二字节校验
$510=$502
$500=$500^$510
FOR 8
#循环右移1位
$509.0=GETB $500.0
$500=$500>>1
$500.15=GETB $509.0
IF $500<8000H THEN GOTO LABEL 20
$500=$500-8000H
$500=$500^$511
LABEL 20
NEXT
#第三字节校验
$510=$503
$500=$500^$510
FOR 8
#循环右移1位
$509.0=GETB $500.0
$500=$500>>1
$500.15=GETB $509.0
IF $500<8000H THEN GOTO LABEL 30
$500=$500-8000H
$500=$500^$511
LABEL 30
NEXT
#第四字节校验
$510=$504
$500=$500^$510
FOR 8
#循环右移1位
$509.0=GETB $500.0
$500=$500>>1
$500.15=GETB $509.0
IF $500<8000H THEN GOTO LABEL 40
$500=$500-8000H
$500=$500^$511
LABEL 40
NEXT
#第五字节校验
$510=$505
$500=$500^$510
FOR 8
#循环右移1位
$509.0=GETB $500.0
$500=$500>>1
$500.15=GETB $509.0
IF $500<8000H THEN GOTO LABEL 50
$500=$500-8000H
$500=$500^$511
LABEL 50
NEXT
#第六字节校验
$510=$506
$500=$500^$510
FOR 8
#循环右移1位
$509.0=GETB $500.0
$500=$500>>1
$500.15=GETB $509.0
IF $500<8000H THEN GOTO LABEL 60
$500=$500-8000H
$500=$500^$511
LABEL 60
NEXT
RET
凑合看看吧。