摘要:
An Internet checksum for use by TCP/IP is generated in a single macro-instruction called a Block Add Octets instruction. Extraneous overhead of macro-instruction looping and bit masking is eliminated by combining checksum operations into a single macro-instruction using a block add approach. The programmer specifies the address in memory and the number of double-words of message data to be added together within a single instance of the Block Add Octets instruction so that looping and jump/branch instructions are not needed. The Block Add Octets instruction fetches all octets (8-bit data segments) contained in full double words from memory and adds them into the checksum. The method handles partial double words of data, full double words, and odd numbers of double words, whereby a double word consists of four octets. The checksum is calculated using one's complement arithmetic rather than two's complement, thereby increasing the speed of checksum calculation because the "end around carry" is eliminated. The number of octets that can be added to the checksum per processor cycle is greatly increased, thereby significantly improving overall TCP/IP performance.