Correct typos and formatting in listing 3.6
This commit is contained in:
parent
6d7fcf71b1
commit
879524acd5
1 changed files with 17 additions and 17 deletions
|
|
@ -1932,25 +1932,25 @@ timing.
|
||||||
;
|
;
|
||||||
; By Michael Abrash
|
; By Michael Abrash
|
||||||
;
|
;
|
||||||
mystack segment para stack ‘STACK'
|
mystack segment para stack 'STACK'
|
||||||
db 512 dup(?)
|
db 512 dup(?)
|
||||||
mystack ends
|
mystack ends
|
||||||
;
|
;
|
||||||
Code segment para public ‘CODE'
|
Code segment para public 'CODE'
|
||||||
assume cs:Code, ds:Code
|
assume cs:Code, ds:Code
|
||||||
extrn ZTimerOn:near, ZTimerOff:near, ZTimerReport:near
|
extrn ZTimerOn:near, ZTimerOff:near, ZTimerReport:near
|
||||||
Startproc near
|
Start proc near
|
||||||
push cs
|
push cs
|
||||||
pop ds ;point DS to the code segment,
|
pop ds ;point DS to the code segment,
|
||||||
; so data as well as code can easily
|
; so data as well as code can easily
|
||||||
; be included in TESTCODE
|
; be included in TESTCODE
|
||||||
;
|
;
|
||||||
; Delay for 6-7 seconds, to let the Enter keystroke that started the
|
; Delay for 6-7 seconds, to let the Enter keystroke that started the
|
||||||
; program come back up.
|
; program come back up.
|
||||||
;
|
;
|
||||||
mov ah,2ch
|
mov ah,2ch
|
||||||
int 21h ;get the current time
|
int 21h ;get the current time
|
||||||
mov bh,dh ;set the current time aside
|
mov bh,dh ;set the current time aside
|
||||||
DelayLoop:
|
DelayLoop:
|
||||||
mov ah,2ch
|
mov ah,2ch
|
||||||
push bx ;preserve start time
|
push bx ;preserve start time
|
||||||
|
|
@ -1962,12 +1962,12 @@ DelayLoop:
|
||||||
add dh,60 ;yes, a minute must have turned over,
|
add dh,60 ;yes, a minute must have turned over,
|
||||||
; so add one minute
|
; so add one minute
|
||||||
CheckDelayTime:
|
CheckDelayTime:
|
||||||
sub dh,bh ;get time that's passed
|
sub dh,bh ;get time that's passed
|
||||||
cmp dh,7 ;has it been more than 6 seconds yet?
|
cmp dh,7 ;has it been more than 6 seconds yet?
|
||||||
jb DelayLoop ;not yet
|
jb DelayLoop ;not yet
|
||||||
;
|
;
|
||||||
include TESTCODE ;code to be measured, including calls
|
include TESTCODE ;code to be measured, including calls
|
||||||
; to ZTimerOn and ZTimerOff
|
; to ZTimerOn and ZTimerOff
|
||||||
;
|
;
|
||||||
; Display the results.
|
; Display the results.
|
||||||
;
|
;
|
||||||
|
|
@ -1975,8 +1975,8 @@ CheckDelayTime:
|
||||||
;
|
;
|
||||||
; Terminate the program.
|
; Terminate the program.
|
||||||
;
|
;
|
||||||
mov ah,4ch
|
mov ah,4ch
|
||||||
int 21h
|
int 21h
|
||||||
Start endp
|
Start endp
|
||||||
Code ends
|
Code ends
|
||||||
end Start
|
end Start
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue