qa.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Pause
   Example  Back  Contents  Index
──────────────────────────────────────────────────────────────────────────────
 
;* Pause - Waits for specified number of clocks to elapse, then returns.
;*
;* Shows:   BIOS Interrupt - 1Ah, Function 0 (Real-Time Clock Driver)
;*          Operators - LOCAL     []
;*
;* Params:  duration - Desired duration in clocks, where
;*                     18 clocks = approx 1 second
;*
;* Return:  None
 
Pause   PROC \
        duration:WORD
 
        LOCAL time:DWORD
 
        sub     ah, ah
        int     1Ah                     ; Get Clock Count in CX:DX
        add     dx, duration            ; Add pause time to it
        adc     cx, 0
        mov     WORD PTR time[0], dx    ; Result is target time;
        mov     WORD PTR time[2], cx    ;   keep in local variable
loop1:  int     1AH                     ; Now repeatedly poll clock
        cmp     dx, WORD PTR time[0]    ;   count until the target
        jb      loop1                   ;   time is reached
        cmp     cx, WORD PTR time[2]
        jb      loop1
        ret
 
Pause   ENDP
                                    -♦-