home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zenasmlg
/
zen_list.exe
/
LST10-10.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
520b
|
24 lines
;
; *** Listing 10-10 ***
;
; Sets every element of a 1000-byte array to 1 by
; repeating STOSW 500 times.
;
jmp Skip
;
ARRAY_LENGTH equ 1000
WordArray db ARRAY_LENGTH dup (?)
;
Skip:
call ZTimerOn
mov di,seg WordArray
mov es,di ;point ES:DI to the array to fill
mov di,offset WordArray
mov ax,(1 shl 8) + 1
;fill each byte with the value 1
mov cx,ARRAY_LENGTH/2 ;# of words to fill
cld ;make STOSW add 2 to DI on each
; execution
rep stosw ;fill a word at a time
call ZTimerOff