您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 房地产 > 汇编实现加减乘除的程序
DATASEGMENTSTRING1DB0DH,0AH,'Pleaseinputthefirstnumbers:',0DH,0AH,'$'STRING2DB0DH,0AH,'Pleaseinputthesecondnumbers:',0DH,0AH,'$'NUM1DW0NUM2DW0DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEADX,STRING1;9ºÅ¹¦ÄÜ,ÏÔʾ×Ö·û´®1ÊäÈëµÚÒ»¸öÊýMOVAH,09HINT21HLP:MOVAH,1INT21HCMPAL,0DH;µ±ÊäÈëµÄ×Ö·ûΪ»Ø³µ½áÊøÊý¾ÝÊäÈëJZNEXTSUBAL,30HMOVAH,0MOVCX,AXMOVBX,10MOVAX,NUM1MULBXADDAX,CXMOVNUM1,AXJMPLPNEXT:LEADX,STRING2;9ºÅ¹¦ÄÜ,ÏÔʾ×Ö·û´®2ÊäÈëµÚ¶þ¸öÊýMOVAH,09HINT21HLP1:MOVAH,1INT21HCMPAL,0DHJZNEXT1;;µ±ÊäÈëµÄ×Ö·ûΪ»Ø³µ½áÊøÊý¾ÝÊäÈëSUBAL,30HMOVAH,0MOVCX,AXMOVBX,10MOVAX,NUM2MULBXADDAX,CXMOVNUM2,AXJMPLP1NEXT1:CALLDOO;µ÷Óû»ÐÐ×Ó³ÌÐòCALLA;µ÷Óüӷ¨×Ó³ÌÐòCALLDOOCALLB;µ÷Óüõ·¨×Ó³ÌÐòCALLDOOCALLC;µ÷Óó˷¨×Ó³ÌÐòCALLDOOCALLD;µ÷Óû»ÐÐ×Ó³ÌÐòMOVAH,4CH;·µ»ØDOSINT21HAPROCNEAR;¼Ó·¨×Ó³ÌÐòMOVDX,NUM1CALLPRINT;µ÷ÓÃÊý¾ÝÒÔÊ®½øÖÆÊä³ö×Ó³ÌÐò£¬°ÑNUM1ÒÔÊ®½øÖÆÐÎʽÊä³öMOVDL,'+'CALLSTDOUT;µ÷ÓÃÊä³ö×Ó³ÌÐò£¬°Ñ+ºÅÊä³öMOVDX,NUM2CALLPRINTMOVDL,'=';µ÷ÓÃÊä³ö×Ó³ÌÐò£¬°Ñ=ºÅÊä³öCALLSTDOUTMOVAX,NUM1ADDAX,NUM2MOVDX,AXCALLPRINTRETAENDPBPROCNEAR;¼õ·¨×Ó³ÌÐòMOVDX,NUM1CALLPRINTMOVDL,'-'CALLSTDOUTMOVDX,NUM2CALLPRINTMOVDL,'='CALLSTDOUTMOVAX,NUM1MOVBX,NUM2SUBAX,BXMOVDX,AXCALLPRINTRETBENDPCPROCNEAR;³Ë·¨×Ó³ÌÐòMOVDX,NUM1CALLPRINTMOVDL,'*'CALLSTDOUTMOVDX,NUM2CALLPRINTMOVDL,'='CALLSTDOUTMOVAX,NUM1MOVDX,0MULNUM2MOVDX,AXCALLPRINTRETCENDPDPROCNEAR;³ý·¨×Ó³ÌÐòMOVDX,NUM1CALLPRINTMOVDL,'/'CALLSTDOUTMOVDX,NUM2CALLPRINTMOVDL,'='CALLSTDOUTMOVDX,0MOVAX,NUM1DIVNUM2MOVDX,AXCALLPRINTRETDENDPPRINTPROCNEAR;Êý¾ÝÒÔÊ®½øÖÆÊä³ö×Ó³ÌÐòPUSHDXPUSHAXPUSHCXPUSHBXMOVCX,0DO:MOVAX,DXMOVDX,0MOVBX,10DIVBXXCHGAX,DXADDAL,30HPUSHAXINCCXCMPDX,0JNZDODO1:POPAXMOVDL,ALCALLSTDOUTLOOPDO1POPBXPOPCXPOPAXPOPDXRETPRINTENDPSTDOUTPROCNEAR;Êä³ö×Ó³ÌÐòMOVAH,2INT21HRETSTDOUTENDPDOOPROCNEAR;»»ÐÐ×Ó³ÌÐòMOVAH,02HMOVDL,0DHINT21HMOVAH,02HMOVDL,0AHINT21HRETDOOENDPCODEENDSENDSTART
本文标题:汇编实现加减乘除的程序
链接地址:https://www.777doc.com/doc-7317789 .html