home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zenasmlg
/
zen_list.exe
/
LST7-1.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
472b
|
20 lines
;
; *** Listing 7-1 ***
;
; Calculates the 16-bit sum of all bytes in a 64Kb block.
;
; Time with LZTIME.BAT, since this takes more than
; 54 ms to run.
;
call ZTimerOn
sub bx,bx ;we'll just sum the data segment
sub cx,cx ;count 64K bytes
mov ax,cx ;set initial sum to 0
mov dh,ah ;set DH to 0 for summing later
SumLoop:
mov dl,[bx] ;get this byte
add ax,dx ;add the byte to the sum
inc bx ;point to the next byte
loop SumLoop
call ZTimerOff