home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Programming Black Book (Special Edition)
/
BlackBook.bin
/
disk1
/
zoa
/
zen_list.exe
/
LST13-6.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
807b
|
30 lines
;
; *** Listing 13-6 ***
;
; Measures the time needed to set AL, based on the contents
; of DL, with test-and-branch code (a branch is required no
; matter what value DL contains).
;
;----------------------------------------------------------
; Macro to perform the test of DL and setting of AL.
; It's necessary to use a macro because the LOCAL directive
; doesn't work properly inside REPT blocks with MASM.
;
TEST_DL_AND_SET_AL macro
local DLGreaterThan10, DLCheckDone
cmp dl,10 ;is DL greater than 10?
ja DLGreaterThan10 ;yes, so set AL to 1
sub al,al ;DL is <= 10
jmp short DLCheckDone
DLGreaterThan10:
mov al,1 ;DL is greater than 10
DLCheckDone:
endm
;
mov dl,10 ;AL will always be set to 0
call ZTimerOn
rept 1000
TEST_DL_AND_SET_AL
endm
call ZTimerOff