DOS下如何对AC97声卡编程播放WAV格式音乐??
;资料有限,AC97的总线号为0,设备号31,功能号为2,得到NATIVE AUDIO MIXTER BASE ;ADDRESS=F000H;NATIVE BUS MASTER BASE ADDRESS=FA00H
;PCM OUT VOLUME MUTE ADDRESS=18H
;PCM FRONT DAC RATE=2CH
;PCM OUT CONTROL REG=1BH(NAMBA)
;GLOBAL CINTROL REG=2CH(NAMBA)
.model small
.386
.data
wavname db 'f:\asm\wavefile\a.wav',00
.code
start:
mov ax,@data
mov ds,ax
mov ax,3d00h
mov dx,offset wavname
int 21h
mov bx,ax
mov ax,2000h
mov ds,ax
mov ax,3f00h
mov cx,0a000h
mov dx,0
int 21h
mov dx,0fa2ch ;AC97 COLD RESET
mov ax,02
out dx,ax
mov dx,0f018h
mov ax,0ffffh
out dx,ax
mov dx,0f02ch
mov ax,0ac44h ;44100HZ
out dx,ax
mov dx,0f02eh ;前端及环绕声频率
out dx,ax
mov dx,0fa15h ;PCM OUT LAST VALID INDEX
mov al,0
out dx,al
mov dx,0fa16h ;PCM OUT STATUS REG
mov ax,0
out dx,ax
mov dx,0fa1ah ;PCM OUT PREFECH INDEX REG
mov al,0
out dx,al
mov dx,0fa10h ;PCM OUT BUFFER DESCRIPTOR LIST REG
mov eax,40000h
out dx,eax
cld
mov ax,4000h
mov es,ax
mov di,0
mov eax,20000h
stosd
mov ax,0A000h
stosw
mov ax,8000h
stosw
mov dx,0fa1bh
mov al,1
out dx,al ;PCM OUT START
mov ax,0ffffh
l0:
mov cx,0ffffh
l1:dec cx
cmp cx,0
jnz l1
dec ax
cmp ax,0
jnz l0
mov ah,4ch
int 21h
end start
小弟最近看INTEL 82801AB ,想在DOS下编个声卡发生程序,只能用 NATIVE MIXER 的BEEP寄存器发出简单声音,请问如何才能让AC97声卡播放音乐??
我的这个程序怎么一点声音反应都没有??
请问各位大哥是哪里错了??
我的资料来源INTEL 82801AB ICH0
本人农民工自学不容易,各位进来此贴的一定要回个贴,不吝赐教,谢谢