插入音乐
CODE SEGMENTASSUME CS:CODE,DS:CODE
START: MOV AX,CODE
MOV DS,AX
MOV AX,0B800H
MOV ES,AX
CLD
AGAIN: MOV AX,3
INT 10H
LEA DX,MENU
MOV AH,9
INT 21H
INPUT:
MOV AH,0
INT 16H
CMP AL,'1'
JNZ CP2
CALL SUB01
JMP INPUT
CP2:CMP AL,'2'
JNZ CP3
CALL SUB02
JMP AGAIN
CP3:CMP AL,'3'
JNZ INPUT
LEA DX,MESG
MOV AH,9
INT 21H
MOV AH,1
INT 21H
MOV AH,4CH
INT 21H
DELAY PROC
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV AH,2
INT 1AH
MOV BL,DH
@T:
MOV AH,2
INT 1AH
CMP DH,BL
JZ @T
POP DX
POP CX
POP BX
POP AX
RET
DELAY ENDP
SUB01:
LEA DX,TIPS
MOV AH,9
INT 21H
LEA DX,STR0
MOV AH,0AH
INT 21H
MOV AX,0E0AH
INT 10H
RET
SUB02:
CMP STR0+1,2
JNB Y2
JMP QUIT
Y2:
CALL LINE
CALL ASDF
@INPUT:
MOV AH,0
INT 16H
CMP AH,10H
JZ SSS
CMP AH,13H
JNZ @INPUT
JMP Y2
SSS:MOV STR0+1,0
MOV FLAG,0
QUIT:
XOR DI,DI
MOV CX,80*25
MOV AX,720H
REP STOSW
RET
LINE:
MOV DI,(18*80+10)*2
MOV AL,201
MOV AH,4
STOSW
MOV CX,60-2
MOV AL,205
REP STOSW
MOV AL,187
STOSW
ADD DI,20*2
MOV AL,186
STOSW
MOV LEFT,DI
MOV CX,60-2
MOV AL,20H
REP STOSW
;MOV RIGHT,DI
MOV AL,186
STOSW
ADD DI,20*2
MOV AL,200
STOSW
MOV CX,60-2
MOV AL,205
REP STOSW
MOV AL,188
STOSW
RET
ASDF:
MOV DI,LEFT
ADD DI,60-2
MOV POSI,DI
MOV AL,STR0+1
CBW
TEST AX,1
JZ OUSHU
MOV FLAG,1
OUSHU:
MOV BP,AX
DEC BP
INC AX
SHR AX,1
LEA DX,BUF
ADD BP,DX
MOV BX,AX
@REP:
MOV AH,70H
MOV CX,TIMES
MOV SI,DX
MOV DI,POSI
@1: LODSB
STOSW
LOOP @1
CALL DELAY
CMP BX,1
JNZ CONT
CMP FLAG,0
JNZ YYY
CONT:
MOV SI,BP
MOV CX,TIMES
@2: LODSB
STOSW
LOOP @2
CALL DELAY
YYY:
DEC BX
JZ DONE
INC TIMES
SUB POSI,2
DEC BP
JMP @REP
DONE:
MOV TIMES,1
RET
TIMES DW 1
FLAG DB 0
POSI DW 0
MENU DB 5 DUP(0AH)
DB 31 DUP(' '),'MAIN MENU',0DH,0AH
DB 25 DUP(' '),201,21 DUP(205),187,0DH,0AH
DB 25 DUP(' '),186,' 1.INPUT A STRING ...',186,0DH,0AH
DB 25 DUP(' '),186,' 2.DISPLAY MODEL ... ',186,0DH,0AH
DB 25 DUP(' '),186,' 3.RETURN TO DOS ... ',186,0DH,0AH
DB 25 DUP(' '),200,21 DUP(205),188,0DH,0AH
DB 28 DUP(' '),'CHOICE(1,2,3):$'
TIPS DB 0DH,0AH,9,'INPUT A STRING ...',0DH,0AH,9,'$'
MESG DB 0DH,0AH,0DH,0AH,9,'PRESS ANY KEY TO EXIT ...$'
LEFT DW 0
STR0 DB 50
DB 0
BUF DB 50 DUP(0)
CODE ENDS
END START
想问下先如何在这段程序中插入音乐,这段程序是输入一串字符,之后从中间向两边输出,想在字符串输出时音乐,还有几句话(其中加粗的)不是很懂,求指教
谢谢各位了