微机原理实验八---排序实验

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

实验八排序实验一、要求:从首地址为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

1 / 5
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功