home *** CD-ROM | disk | FTP | other *** search
- ;
- ; *** Listing 2 ***
- ;
- ; Program to measure performance of code that takes less than
- ; 54 ms to execute.
- ;
- ; Link with Listing 1.
- ;
- stack segment para stack 'STACK'
- db 512 dup(?)
- stack ends
-
- Code segment para public 'CODE'
- assume cs:Code, ds:code
- extrn TimerOn:near, TimerOff:near, TimerReport:near
- Start proc near
- ; Start the timer.
- call TimerOn
- ; ***** Code to be measured starts here *****
- rept 1000
- shr dx,1
- shr dx,1
- shr dx,1
- add ax,dx
- endm
- ; ***** Code to be measured ends here *****
- ;
- ; Stop the timer.
- call TimerOff
- ; Display the results.
- call TimerReport
- ; Terminate the program.
- mov ah,4ch
- int 21h
- Start endp
- Code ends
- end Start
-