home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zoa
/
zen_list.exe
/
LST10-6.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
580b
|
26 lines
;
; *** Listing 10-6 ***
;
; Searches a word-sized array for the first element
; greater than 10,000, using LODSW & CMP.
;
jmp Skip
;
WordArray dw 1000 dup (0), 10001
;
Skip:
call ZTimerOn
mov si,offset WordArray
;array to search
mov dx,10000 ;value we'll compare with
cld ;make LODSW add 2 to SI after each
; execution
SearchLoop:
lodsw ;get the next element
cmp dx,ax ;compare the element to 10,000
jae SearchLoop ;if not greater than 10,000, do
; the next element
dec di ;point back to the matching word
dec di
call ZTimerOff