实验八排序实验一、要求:从首地址为1000H内存区开始存放50个数,设计程序将这些数由小到大排序,排序后的数,仍放在原区域中。二、目的:掌握用汇编语言编写气泡排序程序的思路和方法。CRLFMACROMOVAH,02HMOVDL,0DHINT21HMOVAH,02HMOVDL,0AHINT21HENDMDATASEGMENTSORTNUMEQU50MESSDB'startin1000:0,50numbersfromlittletolarge:',0DH,0AH,'$'DATAENDSSTACKSEGMENTSTADW32DUP(?)TOPDW?STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATA,ES:DATA,SS:STACKSTART:MOVAX,DATAMOVDS,AXMOVES,AXMOVSP,TOPMOVSI,0MOVAX,1000HMOVDS,AXMOVCX,SORTNUMDECCXXORBX,BXIII:MOVAL,[SI+BX]MOVAH,BLPUSHCXMOVDX,BXJJJ:INCDXPUSHBXMOVBX,DXCMPAL,[SI+BX]JBEUUUMOVAL,[SI+BX]MOVAH,DLUUU:POPBXLOOPJJJMOVCL,[SI+BX]MOV[SI+BX],ALMOVDL,AHPUSHBXMOVBX,DXMOV[SI+BX],CLPOPBXINCBX1POPCXLOOPIIIPUSHDSMOVAX,DATAMOVDS,AXMOVAH,09HMOVDX,OFFSETMESSINT21HPOPDSMOVCX,SORTNUMVVV:MOVAL,[SI]CALLDISP1PUSHAXPUSHDXMOVDL,20HMOVAH,02HINT21HPOPDXPOPAXINCSILOOPVVVMOVAX,4C00HINT21HDISP1PROCNEARPUSHCXMOVBL,ALMOVDL,BLMOVCL,04ROLDL,CLANDDL,0FHCALLDISPLMOVDL,BLANDDL,0FHCALLDISPLPOPCXRETDISP1ENDPDISPLPROCNEARADDDL,30HCMPDL,3AHJBDDDADDDL,27HDDD:MOVAH,02HINT21HRETDISPLENDPCODEENDSENDSTART