取crc16 易语言汇编置入代码
.版本 2.子程序 汇编_取CRC16, 文本型, , 非查表法 翻译论坛发布的源码改写而成作者cf2006a
.参数 数据, 字节集
.局部变量 缓存, 文本型
缓存 = 取重复文本 (8, “F”)
' 置入代码 ({ 139, 117, 8, 139, 54, 131, 198, 4, 139, 14, 131, 198, 3, 187, 255, 255, 0, 0, 70, 49, 192, 49, 210, 138, 6, 49, 195, 137, 216, 66, 131, 227, 1, 131, 251, 1, 117, 9, 209, 232, 53, 1, 160, 0, 0, 235, 2, 209, 232, 137, 195, 131, 250, 7, 118, 227, 226, 216, 201, 194, 4, 0 })'这个是返回短整数 没有转成十六进制文本
置入代码 ({ 139, 117, 8, 139, 54, 131, 198, 4, 139, 14, 131, 198, 3, 187, 255, 255, 0, 0, 70, 49, 192, 49, 210, 138, 6, 49, 195, 137, 216, 66, 131, 227, 1, 131, 251, 1, 117, 9, 209, 232, 53, 1, 160, 0, 0, 235, 2, 209, 232, 137, 195, 131, 250, 7, 118, 227, 226, 216, 137, 194, 139, 125, 252, 79, 49, 201, 177, 8, 136, 208, 36, 15, 60, 9, 119, 4, 4, 48, 235, 2, 4, 55, 136, 4, 57, 193, 234, 4, 116, 2, 226, 232, 141, 4, 57, 137, 69, 252, 201, 194, 4, 0 })
返回 (“”)
' *** 缩略程序块 ***
' mov esi, dword
' mov esi, dword
' add esi, 0x04
' mov ecx, dword
' add esi, 0x03
' mov ebx, 0x0000FFFF
' label1:
' inc esi
' xor eax, eax
' xor edx, edx
' mov al, byte
' xor ebx, eax
' label2:
' mov eax, ebx
' inc edx
' and ebx, 0x01
' cmp ebx, 0x01
' jne label3
' shr eax, 1
' xor eax, 0x0000A001
' jmp label4
' label3:
' shr eax, 1
' label4:
' mov ebx, eax
' cmp edx, 0x07
' jbe label2
' loop label1
' mov edx, eax
' mov edi, dword
' dec edi
' xor ecx, ecx
' mov cl, 0x08
' label5:
' mov al, dl
' and al, 0x0F
' cmp al, 0x09
' jnbe label6
' add al, 0x30
' jmp label7
' label6:
' add al, 0x37
' label7:
' mov byte , al
' shr edx, 0x04
' je label8
' loop label5
' label8:
' lea eax, dword
' mov dword , eax
' leave
' retn 0x0004
页:
[1]