标题:[求助]不能发声
只看楼主
ADALE
Rank: 2
等 级:新手上路
威 望:4
帖 子:483
专家分:0
注 册:2005-11-18
 问题点数:0 回复次数:0 
[求助]不能发声



RT 帮我看看应该怎样修改

desg segment
music_freq dw 262 ;C
dw 294 ;D
dw 330 ;E
dw 349 ;F
dw 392 ;G
dw 440 ;A
dw 494 ;B
dw 523 ;C
music_note db 1,2,3,4,5,6,7,8,8,7,6,5,4,3,2,1

desg ends

cseg segment
assume cs:cseg,ds:desg
start:
mov ax,desg ;initialize DS
mov ds,ax
mov cx,16
mov si,offset music_note

sound:mov bx,offset music_freq
mov
mov di,[bx][si]
mov bx,5000
call gensound ;ip
inc si
loop sound
exit:
mov ah,4ch ;演奏完毕后,退出程序
int 21h

;给定频率BX和节奏DI,最简单的发声子程序
gensound proc
push ax
push bx
push cx
push dx
push di
mov al,0b6h
out 43h,al
mov dx,12h
mov ax,533h*896
div di
out 42h,al
mov al,ah
out 42h,al
in al,61h
mov ah,al
or al,3
out 61h,al
wait1: mov cx,28010
delay: loop delay
dec bx
jnz wait1
mov al,ah
out 61h,al
pop di
pop dx
pop cx
pop bx
pop ax
ret
gensound endp
cseg ends

搜索更多相关主题的帖子: 发声 
2006-06-12 12:46



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-71637-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018574 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved