home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zoa
/
zen_list.exe
/
LST8-15.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
493b
|
23 lines
;
; *** Listing 8-15 ***
;
; Adds AL to each element in an array until the result
; of an addition exceeds 7Fh.
; Uses LAHF and SAHF.
;
jmp Skip
;
Data db 999 dup (0),7fh
;
Skip:
mov bx,offset Data
mov al,2 ;we'll add 2 to each array element
call ZTimerOn
AddLoop:
add [bx],al ;add the value to this element
lahf ;save the sign flag
inc bx ;point to the next array element
sahf ;get back the sign flag
jns AddLoop ;do the next element, if any
call ZTimerOff