用汇编语言 实现 两数相加
SSEGSEGMENTSTACKSTKDB20DUP(?)SSEGENDSDSEGSEGMENTDATA1DB255DB0DB255DUP(0)DATA2DB255DB0DB255DUP(0)DATA3DB255DUP(0)DATA4DB255DUP(0)LEN1DW0LEN2DW0LENDW0DATA5DB255DUP(0)STRDB0AH,0DH,'$'SPACEDB20H,'$'JINWEIDB0DSEGENDSCSEGSEGMEN ,DS:DSEG,SS: ,DSEGMOVDS,AXMOVDX,OFFSETDATA1MOVAH,0AHINT21HCALLHuiChe_HuanHan...全部
SSEGSEGMENTSTACKSTKDB20DUP(?)SSEGENDSDSEGSEGMENTDATA1DB255DB0DB255DUP(0)DATA2DB255DB0DB255DUP(0)DATA3DB255DUP(0)DATA4DB255DUP(0)LEN1DW0LEN2DW0LENDW0DATA5DB255DUP(0)STRDB0AH,0DH,'$'SPACEDB20H,'$'JINWEIDB0DSEGENDSCSEGSEGMEN ,DS:DSEG,SS: ,DSEGMOVDS,AXMOVDX,OFFSETDATA1MOVAH,0AHINT21HCALLHuiChe_HuanHangMOVDX,OFFSETDATA2MOVAH,0AHINT21HCALLHuiChe_HuanHangMOVCL,DATA1[1]MOVCH,0MOVBX,CXMOVDI,0MOVSI,1L0:INCSIDECCXMOVAL,DATA1[SI]CMPAL,'0'JEL0INCCXADDBX,2SUBBX,SIMOVLEN1,BXL01:MOVAL,DATA1[SI]SUBAL,'0'MOVDATA3[DI],ALINCSIINCDILOOPL01MOVCL,DATA2[1]MOVCH,0MOVBX,CXMOVDI,0MOVSI,1L1:INCSIDECCXMOVAL,DATA2[SI]CMPAL,'0'JEL1INCCXADDBX,2SUBBX,SIMOVLEN2,BXL10:MOVAL,DATA2[SI]SUBAL,'0'MOVDATA4[DI],ALINCSIINCDILOOPL10MOVSI,LEN1MOVDI,LEN2CMPSI,DIJAEL2MOVAX,DIADDAX,1MOVLEN,AXJMPL3L2:MOVAX,SIADDAX,1MOVLEN,AXL3:MOVBX,LENMOVAL,DATA3[SI-1]ADDAL,DATA4[DI-1]DAAMOVAH,ALANDAH,0F0HJZL31MOVJINWEI,1ANDAL,0FHL31:MOVDATA5[BX-1],ALCMPSI,1JEL5CMPDI,1JEL6L4:DECSIDECDIDECBXMOVAL,DATA3[SI-1]ADDAL,JINWEIADDAL,DATA4[DI-1]DAAMOVJINWEI,0MOVAH,ALANDAH,0F0HJZL41MOVJINWEI,1ANDAL,0FHL41:MOVDATA5[BX-1],ALCMPSI,1JEL5CMPDI,1JEL6JMPL4L5:CMPDI,1JEL7L51:DECDIDECBXMOVAL,DATA4[DI-1]ADDAL,JINWEIDAAMOVJINWEI,0MOVAH,ALANDAH,0F0HJZL52MOVJINWEI,1ANDAL,0FHL52:MOVDATA5[BX-1],ALCMPDI,1JEL7JMPL51L6:CMPSI,1JEL7L61:DECSIDECBXMOVAL,DATA3[SI-1]ADDAL,JINWEIDAAMOVJINWEI,0MOVAH,ALANDAH,0F0HJZL62MOVJINWEI,1ANDAL,0FHL62:MOVDATA5[BX-1],ALCMPSI,1JEL7JMPL61L7:MOVAL,JINWEIADDDATA5[0],ALL8:MOVSI,LEN1MOVDI,LEN2MOVBX,LENMOVDATA5[BX],'$'MOVDATA3[SI],'$'MOVDATA4[DI],'$'CALLHuiChe_HuanHangL9:ADDDATA5[BX-1],'0'DECBXJNZL9L91:ADDDATA3[SI-1],'0'DECSIJNZL91L92:ADDDATA4[DI-1],'0'DECDIJNZL92MOVAL,DATA5[0]CMPAL,'0'JNELAAMOVSI,1SUBLEN,1 ,0 ,LENSUBCX,LEN1CALLSPPMOVDX,OFFSETDATA3MOVAH,09HINT21HCALLHuiChe_HuanHangMOVCX,LENSUBCX,LEN2CALLSPPMOVDX,OFFSETDATA4MOVAH,09HINT21HCALLHuiChe_HuanHangCMPSI,1JELLLLMOVDX,OFFSETDATA5MOVAH,09HINT21HJM ,OFFSETDATA5+1MOVAH,09HINT21HJMPDONESPPPROCNEAR;输出空格子程序CMPCX,0JZDD10 ,OFFSETSPACEMOVAH,09HINT21HDECCXJNZLPPDD10:RETSPPENDPHuiChe_HuanHangPROCNEAR;回车换行子程序MOVDX,OFFSETSTRMOVAH,09HINT21HRETHuiChe_HuanHan ,4CHINT21HCSEGENDSENDSTART。
收起