2、einputRorrtocontinue...>',0dh,0ah,'$'msg2db0dh,0ah,'',0dh,0ah,'$'msg3db0dh,0ah,'',0dh,0ah,'$'msg4db0dh,0ah,'Recording...',0dh,0ah,'$'msg5db0dh,0ah,'Playing...',0dh,0ah,'$'msg6db'Input:','$'msg7db0dh,0a
3、h,'Thankyou!',0dh,0ah,'$'msg8db0dh,0ah,'RecordComplete!',0dh,0ah,'$'msg9db0dh,0ah,'PlayOver.',0dh,0ah,'$';msg10db0dh,0ah,'Ifyouwanttopause,pressanykey!','$'msg11db0dh,0ah,'',0dh,0ah,'$'msg12db'',0dh,0ah,'$'bufdb60000dup(?)DATASE
4、NDSCODESSEGMENTASSUMECS:CODES,DS:DATASSTART:MOVAX,DATASMOVDS,AXMOVDX,OFFSETMSG0;显示按R开始MOVAH,09HINT21HMOVDX,OFFSETMSG6;显示并等待inputMOVAH,09HINT21HCHOOSE0:;直到输入r为止才开始录音MOVAH,1INT21HCMPAL,'R'JZOK0CMPAL,'r'JZOK0MOVDX,OFFSETMSG1;提示输入错误,继续要输入MOVAH,09HINT21HMOVDX,OFFSETM
5、SG6MOVAH,09HINT21HJNZCHOOSE0OK0:MOVDX,OFFSETMSG4;开始录音MOVAH,09HINT21HMOVDI,OFFSETBUFMOVCX,30000REC:MOVDX,IO0809;启动0809将模拟信号转化成数字信号OUTDX,ALCALLDELAYINAL,DX;输入转化数据MOV[DI],ALINCDILOOPREC;一直循环30000次,因为cx=30000OK2:MOVDX,OFFSETmsg8MOVAH,09HINT21HMOVDX,OFFSETMSG2MOVAH,0
6、9HINT21HMOVDX,OFFSETMSG6MOVAH,09HINT21HCHOOSE1:;按p进行播音MOVAH,1INT21HCMPAL,'P'JZOK1CMPAL,'p'JZOK1MOVDX,OFFSETMSG3MOVAH,09HINT21HMOVDX,OFFSETMSG6MOVAH,09HINT21HJNZCHOOSE1;直到按了p才进行播音OK1:MOVDX,OFFSETMSG5MOVAH,09HINT21HMOVDI,OFFSETBUFMOVCX,30000PLAY:MOVDX,IO0832;启动083
7、2将数字转换成模拟信号,播音MOVAL,[DI]OUTDX,ALCALLDELAYINCDILOOPPLAY;一直播放直到cx=0MOVDX,OFFSETmsg9MOVAH,09HINT21HMOVDX,OFFSETmsg11MOVAH,09HINT21HMOVDX,OFFSETmsg12MOVAH,09HINT21HREPLAY:;重新播放MOVDX,OFFSETMSG6MOVAH,09HINT21HMOVAH,1INT21HCMPAL,'R'JZOK1CMPAL,'r'JZOK1;按r是重新播放CMPAL,'Q';
8、按q是退出JZQUITCMPAL,'q'JZQUITMOVDX,OFFSETMSG1MOVAH,09HINT21HJNZREPLAYQUIT:MOVDX,OFFSETmsg7MOVAH,09HINT21HMOVAH,4CHINT21HDELAYPROCNEARPUSHDXMOVDX,IO8253CMOVAL,10H;工作方式0,二