home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zenasmlg
/
zen_list.exe
/
LST8-17.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
667b
|
26 lines
;
; *** Listing 8-17 ***
;
; Adds AL to each element in an array until the result
; of an addition exceeds 7Fh.
; Uses one jump in the loop, with a predecrement before
; the loop, an INC before the ADD in the loop, and a final
; INC to adjust BX for the last addition.
;
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
dec bx ;compensate for the initial INC
AddLoop:
inc bx ;point to the next array element
add [bx],al ;add the value to this element
jns AddLoop ;do the next element, if any
EndAddLoop:
inc bx ;adjust BX for the final addition
call ZTimerOff