public sound_off
push ax
cmp sound_on_flag,0
je sound_off_exit
in al,61H ;input port 61h
and al,0FCH
out 61H,al ;output port 61h
mov sound_on_flag,0
sound_off_exit:
pop ax
ret
sound_off endp
;************** %%%%%%%%%% ***************
;with all CX:AX time values, CX is most significant
; and AX is least significant
get_current_time proc near
;on exit CX:AX has 32 bit day clock value
; in 18.2 ticks per second
push dx
xor ax,ax ;set AH to zero
int 1AH ;BIOS Call get time
mov ax,dx
pop dx
ret
get_current_time endp
;****************************
get_time_plus_ax proc near
;on entry AX has 16 bit value to add to current clock time
;on exit CX:AX has new 32 bit clock value
push dx
push ax
xor ax,ax
int 1AH ;BIOS Call
pop ax
add ax,dx
adc cx,0
pop dx
ret
get_time_plus_ax endp
;************ ######## ************
test_current_time proc near
;on entry CX:AX has time value
; to be subtracted from the current time
;on exit if carry set then current time
; is less than CX:AX time
push dx
push cx
push ax
xor ax,ax
int 1AH ;BIOS Call
cmp dx,18
jb test_current_time_2
test_current_time_1:
pop ax
sub dx,ax
pop dx
sbb cx,dx
mov cx,dx
pop dx
ret
test_current_time_2:
or cx,cx
jnz test_current_time_1
pop ax ;this is fix code for midnight factor
pop dx
pop dx
clc ;clear carry condition
ret
test_current_time endp
;*****************************************
end