发表于:2001/6/17 8:37:00
#0楼
关于SNP协议中的BCC:谁可告诉我是什意思,BCC代码的结果在那?是完整的C语言吗?
The Block Check Code (BCC) is calculated as follows:
; assume:
; msg_length = Number of bytes in message over which the BCC
is calculated.
; msg_ptr = Pointer to the first byte (start of message char) of
; the message.
VAR
i : integer; snp_bcc : byte;
BODY
i = 0;
snp_bcc = 0;
while ( i < msg_length)
snp_bcc = snp_bcc XOR (byte contents at (msg_ptr + i))
rotate snp_bcc left by 1; 8-bit rotate (ROTATE HIGH BIT TO LOW BIT)
i = i+1
end while
END BODY
The Block Check Code (BCC) is calculated as follows:
; assume:
; msg_length = Number of bytes in message over which the BCC
is calculated.
; msg_ptr = Pointer to the first byte (start of message char) of
; the message.
VAR
i : integer; snp_bcc : byte;
BODY
i = 0;
snp_bcc = 0;
while ( i < msg_length)
snp_bcc = snp_bcc XOR (byte contents at (msg_ptr + i))
rotate snp_bcc left by 1; 8-bit rotate (ROTATE HIGH BIT TO LOW BIT)
i = i+1
end while
END BODY