汇编语言调用声音程序就显示除法溢出
音乐数据段
;*****************************************************
MDATA_SEG SEGMENT PARA
;======================================================================================
mus_freq dw 659,659,659,523,659,20000,784,20000,392
dw 20000,523,20000,392,20000,330,20000,440
dw 494,494,440,392,659,784,880,20000,698,784
dw 20000,659,20000,523,587,494,20000,523,20000,392,20000
dw 20000,330,20000,440,494,20000,494,440,20000,392,659
dw 784,880,698,784,20000,659,587,523,494
dw 20000,784,698,698,659,659,392,440,523,20000
dw 440,523,587,20000,784,698,698,659,20000,659,1046
mus_time dw 20,20,20,10,10,6,20,6,20
dw 6,10,6,10,6,10,6,20
dw 20,10,20,20,20,20,10,10,6,10,10
dw 6,10,6,10,10,20,6,10,6,10,6
dw 6,10,6,20,10,6,10,20,6,10,20
dw 20,20,20,20,6,20,10,10,40
dw 6,20,10,10,20,20,10,20,20,6
dw 10,10,20,6,10,10,20,20,6,20,20
dw 20,20,6,6,10,10,10,20,10
dw 6,10,10,20,10,10,6,10,6,10,6
dw 20,6,10,6,6,6,10
dw 6,10,10,10,6,10,6,10,10,20,6,10,10,10
dw 6,10,10,10,20,6,10,6,10,6,20,20
dw 6,6,10,10,10,10,6,20,10,10
dw 6,10,6,10,10,10,6,6,10,6,6,10,6
dw 20,6,6,6,10,10,6,10,6
dw 10,10,6,10,6,10,6,10,40,6,10,20
dw 6,10,6,10,10,10,6
dw 6,10,10,6,10,6,10,10,6,6,6
dw 6,20,6,20,6,20,6,20
dw 6,20,20,20,20,20,10,10,6,10
dw 6,10,20,6,10,6,10,20,20,6,10,6
dw 6,10,6,40,20,20,6,10,20
dw 20,20,10,10,6,10,10,6,10,6,10,10
dw 20,6,10,10,6,10,10,10,20
dw 6,10,20,6,10,20,20,10,20,6,40
dw 20,20,20,20,6,6,10,10,6,20
dw 6,10,10,10,6,10,40,6,10,20
dw 6,10,20,10,10,6,10,20,6,10,20,6
;======================================================================================
MDATA_SEG ENDS
beepit PROC NEAR ; 定义意外事件声音
MOV DI,800 ;定义声音频率
MOV BX,100
CALL beep ;定义延迟时间
RET
beepit ENDP
beep PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
MOV AL,0b6h
OUT 43h,AL
MOV DX,12h
MOV AX,348
DIV DI
OUT 42h,AL
MOV AL,AH
OUT 42h,AL
IN AL,61h
MOV AH,AL
OR AL,3
OUT 61h,AL