汇编语言编写播放音乐的程序

2024-12-14 05:06:55
推荐回答(3个)
回答1:

好好看看,这是一个可以播放音乐,康定情歌,其他设计。或者学到什么东西,我祝你成功。

PP EQU 30H
YF EQU 31H
JP EQU 32H

ORG 0000H
AJMP MAIN
ORG 000BH
JMP TIM0

MAIN:ORG 0050H
MOV TMOD,#01H
MOV IE,#82H
; SETB P3.5

SATR0:MOV PP,#0
NEXT:MOV A,PP
MOV DPTR,#粗世QPM
MOVC A,@ A + DPTR
MOV R2,A BR /> MOV A,R2
JZ END0位置
MOV A,R2
ANL A,#0FH
MOV JP,A
MOV A,R2
交换一个
ANL A,#0FH
MOV YF,一个
MOV A,YF
JNZ星
CLR TR0
AJMP D1
BR />星:盯做MOV A,YF
MOV DPTR,#TH
; MOV A,YF
MOVC A,@ A + DPTR
MOV R7,A
R7
的YF
MOV DPTR,#TL
MOVC A,@ A + DPTR
MOV R0,A
MOV TL0,R0
SETB TR0
D1:LCALL DELAY
INC PP
LJMP NEXT

END0:CLR TR0
LJMP SATR0

TIM0,R7
MOV TL0,TH0 MOV R0
CPL P3.5
RETI

DELAY:MOV R6,#2
D2:MOV R5,#120
D3:MOV R4,#248
DJNZ R4,$
DJNZ R5,D3
DJNZ R6,D2
DJNZ JP,DELAY
RET

TH:DB 02H,凯凳衡0FCH,0FCH,0FDH,0FDH,0FDH,0FDH,0FEH,0FBH,0FBH,0FCH,0FEH,0FEH,0FEH,0FEH,0FEH
>

TL:DB 02H,44H,0ACH,09H,34H,82H,0C8H,06H,04H,90H,0CH,22H,56H,65H,9AH,0C1H

QPM:DB 34H,52H,63H,62H,52H,64H,32H,28H
DB 33H,32H,52H,63H,62H,52H,63H,32H,37H
DB 34H,52H,63H,62H,52H,63H,32H,28H
DB 53H,52H,32H,22H,32H,22H,12H,24H,98H
DB 93H,22H,28H,53H, 32H,38H,22H,12H,98H,53H,52H,32H,22H,32H,22H,12H,23H,98H
DB 93H,22H,28H,53H,32H,38H,23H,12H,98H, 53H,52H,32H,22H,32H,22H,12H,22H,65H
DB 00H
END

回答2:

有难度

回答3:

困难