!************************************************************************** !* !* Network driver interface for netboot bootrom !* !* Module: chksum.S !* Purpose: Routine to compute a checksum !* Entries: dochecksum !* !************************************************************************** !* !* Copyright (C) 1998-2003 Gero Kuhlmann !* !* This program is free software; you can redistribute it and/or modify !* it under the terms of the GNU General Public License as published by !* the Free Software Foundation; either version 2 of the License, or !* any later version. !* !* This program is distributed in the hope that it will be useful, !* but WITHOUT ANY WARRANTY; without even the implied warranty of !* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the !* GNU General Public License for more details. !* !* You should have received a copy of the GNU General Public License !* along with this program; if not, write to the Free Software !* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. !* !* $Id: chksum.S,v 1.4 2003/01/25 23:29:41 gkminix Exp $ !* ! !************************************************************************** ! ! Load assembler macros and other include files. ! #include ! !************************************************************************** ! ! Start code segment. ! .text public dochecksum ! !************************************************************************** ! ! Compute checksum of a given memory area ! Input: DS:SI - pointer to memory area ! CX - size of memory area ! Output: AL - checksum ! Registers changed: AX, CX ! dochecksum: cld push si xor ax,ax chks1: lodsb add ah,al ! add all bytes together loop chks1 mov al,ah pop si ret ! !************************************************************************** ! end