|
Programming the internal timer push ds
pop es
mov bx,offset Flag ; must point to a BYTE in your data segment (make sure es=ds)
mov ax,8300h ; (AH) Service 83h, -- (AL)=0 to start timer, 1 to cancel timer
mov cx,004Ch ; 5,000,000 (or 5 sec)
mov dx,4B40h ; cx = high order word of interval time, dx = low order word
int 15h ; 1,000,000 = 1 sec (cx:dx = how many microseconds to wait)
LoopIt: mov al,Flag ; Check to see if flag set (80h)
or al,al ; if it is set then do code
jnz TimerUp ;
.
. do what ever code you wanted to do while timer was tickn'
.
jmp short LoopIt
TimerUp: ; do what ever code you wanted to do when timer was up
|