Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
INCHKSUM.ASM
Package: ertos.rar [view]
Upload User: sunrenlu
Upload Date: 2022-06-13
Package Size: 1419k
Code Size: 1k
Category:
OS Develop
Development Platform:
DOS
- ;
- ;
- ; Usage :
- ; void far *inchksum()
- ;
- ; Internet compatible 1's complement checksum
- ;
- ; (c) 1990 Erick Engelke
- ;
- ; version
- ;
- ; 0.1 17 Dec -1990 E. P. Engelke
- ;
- ;
- include masmdefs.hsm
- include model.hsm
- codedef INCHKSUM
- datadef
- cstart INCHKSUM
- cpublic inchksum
- ; Compute 1's-complement sum of data buffer
- ;
- ; unsigned lcsum( usigned far *buf, unsigned cnt)
- push DS
- lds SI, +@AB + 0 [BP]
- mov CX, +@AB + 4 [BP] ; cx = cnt
- mov BL, CL
- shr CX, 1 ; group into words
- xor DX, DX ; set checksum to 0
- cld
- jcxz remain
- clc
- deloop: lodsw
- adc DX, AX
- loop deloop
- adc DX, 0 ; only two necessary
- adc DX, 0
- remain: and BL, 1
- jz done
- xor AH, AH
- lodsb
- add DX, AX
- adc DX, 0
- adc DX, 0
- done: mov AX,DX ; result into ax
- or AX,AX
- ok: pop DS
- creturn inchksum
- cend INCHKSUM
- end