89c51汇编音乐程序仿真时声音为什么断断续续

2024-11-26 19:55:59
推荐回答(3个)
回答(1):

不知道你的程序是什么样子的,什么样的音乐,断断续续有可能是单片机的处理速度跟不上。
据我所知,汇编语言所写出的音乐音调是那种但和弦的滴滴答答的声音!

回答(2):

你电脑慢,换深蓝或者银河会听到尖叫
要么将你大脑的处理速度降低到与你电脑同步,你也会听到正常的音调

回答(3):

那个程序刚刚给你找了好久才找到,呵呵
HUAN BIT 20H
ORG 0000H
JMP MAIN

ORG 000BH
MOV TL0,R2
MOV TH0,R3
CPL P3.5
RETI

ORG 001BH
DJNZ R4,GOON
MOV IE,#80H
JMP T1END
GOON: MOV TL1,#3CH
MOV TH1,#0B0H
T1END: RETI

ORG 0100H
MAIN: MOV R5,#99H
LOOP: MOV TMOD,#11H
MOV IP,#02H
MOV TH0,#3CH
MOV TL0,#0B0H
SETB EA
NEXT: MOV DPTR,#TAB
MOV R1,#00H
L1: MOV A,R1
MOVC A,@A+DPTR
MOV R3,A
JZ L3
INC R1
MOV A,R1
MOVC A,@A+DPTR
MOV R2,A
XRL A,#0FFH
JNZ L4
MOV A,R3
XRL A,#0FFH
JZ L5
L4: INC R1
MOV A,R1
L3: MOVC A,@A+DPTR
MOV R4,A
MOV TH0,R3
MOV TL0,R2
SETB ET0
SETB TR0
SETB ET1
SETB TR1
SETB HUAN
JB HUAN,$
INC R1
CJNE R1,#00H,L2
INC DPH
L2: JMP L1
L5: DJNZ R5,LOOP
JMP $
TAB: DB 0FBH,0F9H,08H,0FCH,066H,08H,0FCH,0C7H,08H,0FBH,0F9H,08H
DB 0FBH,0F9H,08H,0FCH,066H,08H,0FCH,0C7H,08H,0FBH,0F9H,08H
DB 0FCH,0C7H,08H,0FCH,0F3H,08H,0FDH,0A4H,10H,0FCH,0C7H,08H
DB 0FCH,0F3H,08H,0FDH,04AH,08H,0FDH,04AH,04H,0FDH,095H,04H
DB 0FDH,04AH,04H,0FCH,0F3H,04H,0FCH,0C7H,08H,0FBH,0F9H,08H
DB 0FDH,04AH,04H,0FDH,095H,04H,0FDH,4AH,08H,04H,0FCH,0FCH,04H
DB 0FCH,0C7H,08H,0FBH,0F9H,08H,0FCH,066H,08H,0FAH,093H,08H
DB 0FBH,0F9H,08H,00H,08H,0FCH,66H,04H,0FAH,093H,08H
DB 0FBH,0F9H,08H,00H,10H,0FFH,0FFH
END