为什么程序跳转后有条语句不执行?
程序代码:
DATA SEGMENT INFO1 DB 0DH,0AH,'welcome to this programe!$' INFO2 DB 0DH,0AH,'please enjoy the music!$' INFO6 DB 0DH,0AH,'music was stopped!$' MUSLIST DB 0DH,0AH,'press any key to stop the music!' db 0dh,0ah,'$' ;******************************************音乐 两只老虎 MUS_FREG3 DW 262,294,330,262 DW 262,294,330,262 DW 330,349,392 DW 330,349,392 DW 392,440,392,349,330,262 DW 392,440,392,349,330,262 DW 294,196,262 DW 294,196,262,-1 MUS_TIME3 DW 50,50,50,50 DW 50,50,50,50 DW 50,50,100 DW 50,50,100 DW 25,25,25,25,50,50 DW 25,25,25,25,50,50 DW 50,50,100 DW 50,50,100 DATA ENDS ;*********************************************************** STACK SEGMENT DB 200 DUP ('STACK') STACK ENDS CODE SEGMENT ASSUME DS:DATA,SS:STACK,CS:CODE START: MOV AX,DATA MOV DS,AX MOV aH, 0 MOV AL,00 INT 10H ;********** 定义一个宏显示 DISPLAY MACRO b LEA DX,b MOV AH,9 INT 21H ENDM ;**********************音乐地址宏 ADDRESS MACRO A,B LEA SI,A LEA BP,DS:B ENDM ;*********************** DISPLAY INFO1 DISPLAY INFO2 DISPLAY MUSLIST TIGER: ADDRESS MUS_FREG3,MUS_TIME3 CALL MUSIC JMP TIGER ;******************************************发声 GENSOUND PROC NEAR PUSH AX PUSH BX PUSH CX PUSH DX PUSH DI MOV AL,0B6H OUT 43H,AL MOV DX,12H MOV AX,3280H 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,3314 call waitf DELAY1: DEC BX JNZ WAIT1 MOV AL,AH OUT 61H,AL POP DI POP DX POP CX POP BX POP AX RET GENSOUND ENDP ;******************************************** waitf proc near push ax waitf1: in al,61h and al,10h cmp al,ah je waitf1 mov ah,al loop waitf1 pop ax ret waitf endp ;********************************************* 音乐播放 MUSIC PROC NEAR PUSH DS SUB AX,AX PUSH AX FREG: mov ah, 0bh ;检测是否有任意键按下? int 21h cmp al,00 出现问题:JNE RETU MOV DI,[SI] CMP DI,-1 JE END_MUS MOV BX,DS:[BP] CALL GENSOUND INC SI INC SI INC BP INC BP JMP FREG JMP END_MUS RETU: DISPLAY INFO6 END_MUS: RET MUSIC ENDP CODE ENDS END START
代码见上。这个程序是自动播放一段音乐,然后按任意键结束。正常执行的时候,按任意键结束后,应该显示一条信息“music was stopped!”,也就是我数据段中的变量 INFO6。但是按任意键结束播放,音乐停止后,却没有显示。这是怎么回事啊?我是在音乐播放的循环体中写了一句跳转语句(红色的那行代码),然后跳转执行“RETU: DISPLAY INFO6”
[ 本帖最后由 paul_wing 于 2012-5-14 01:17 编辑 ]