Assembly Language Help (alang.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
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* 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 tick: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 tick[0], dx    ; Result is target time;
        mov     WORD PTR tick[2], cx    ;   keep in local variable
 
        .REPEAT
        int     1Ah                     ; Poll clock until target time
        .UNTIL  (dx >= WORD PTR tick[0]) || (cx >= WORD PTR fileinfo.time[2])
        ret
 
Pause   ENDP
                                    -♦-