home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zenasmlg
/
zen_list.exe
/
LST10-4.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
585b
|
26 lines
;
; *** Listing 10-4 ***
;
; Searches a word-sized array for the first element
; greater than 10,000, using non-string instructions.
;
jmp Skip
;
WordArray dw 1000 dup (0), 10001
;
Skip:
call ZTimerOn
mov di,offset WordArray-2
;start 1 word early so the
; first preincrement points
; to the first element
mov ax,10000 ;value we'll compare with
SearchLoop:
inc di ;point to the next element
inc di
cmp ax,[di] ;compare the next element
; to 10,000
jae SearchLoop ;if not greater than 10,000,
; do the next element
call ZTimerOff