資源描述:
《云南大學 軟件學院 匯編實驗5》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、計算機組成原理與匯編元程序設計實驗報告實驗五80x86分支,循環(huán),子程序,宏程序設計姓名:學號:序號:班級:分數(shù):1.編寫設計一個2,10,16進制的碼制轉(zhuǎn)換程序,要求:①程序有友好的運行界面;②輸入任意類型進制的數(shù)據(jù),轉(zhuǎn)換為其余兩種進制類型;③要求程序有方便的輸入輸出功能;④要求程序能夠處理基本的錯誤信息;⑤程序的基本結(jié)構(gòu)采用子程序結(jié)構(gòu);源程序:.8086.modelsmall.datastrdb0ah,0dh,'pleaseinput1to8tochoisethefunction',0ah,0dhdb'
2、1.btd',0ah,0dhdb'2.bth',0ah,0dhdb'3.dth',0ah,0dhdb'4.dtb',0ah,0dhdb'5.htb',0ah,0dhdb'6.htd',0ah,0dhdb'7.again',0ah,0dhdb'8.end',0ah,0dh,'$'bdb'PleaseinputaBinarynumber',0ah,0dh,'$'ddb'Pleaseinputadecimalnumber',0ah,0dh,'$'hdb'PleaseinputaHexadecimalnumber'
3、,0ah,0dh,'$'agaidb'Pleaseinputagain',0ah,0dh,'$'wrdb'Awrongnumber!',0ah,0dh,'$'numdb6,?,6dup(?)num1db16,?,16dup(?).codestart:movax,@datamovds,axchoice:leadx,strmovah,9int21hmovah,1int21hjmpC1-13-計算機組成原理與匯編元程序設計實驗報告again:movdl,0ahmovah,2int21hmovdl,0dhmovah
4、,2int21hjmpchoiceMo:movdx,offsetagaimovah,9int21hjmpchoiceC1:cmpal,'1'jnzC2callbtdjmpagainC2:cmpal,'2'jnzC3callbthjmpagainC3:cmpal,'3'jnzC4calldthjmpagainC4:cmpal,'4'jnzC5calldtbjmpagainC5:cmpal,'5'jnzC6callhtbjmpagainC6:cmpal,'6'jnzC7callhtdjmpagainC7:cmp
5、al,'7'-13-計算機組成原理與匯編元程序設計實驗報告jnzC8jmpMoC8:cmpal,'8'jnzwrongen:movah,4chint21hwrong:leadx,wrmovah,9int21hjmpMobtdprocmovdx,offsetbmovah,9int21hmovdx,offsetnum1movah,0ahint21hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hmovdi,offsetnum1movch,[di+1]zq2:movdl,[
6、di+2]cmpdl,39hjgzqsubdl,30hjmpzq1zq:subdl,37hzq1:movdh,0orbx,dxcmpch,1jzzq3-13-計算機組成原理與匯編元程序設計實驗報告rolbx,1zq3:incdidecchjnzzq2xorsi,sijj1:cmpbx,10000jcjjsubbx,10000incsijmpjj1jj:movdx,sianddx,0fhadddl,30hmovah,2int21hxorsi,siL1:cmpbx,1000jcL2subbx,1000incsi
7、jmpL1L2:movdx,sianddx,0fhadddl,30hmovah,2int21hxorsi,siL3:cmpbx,100jcL4subbx,100incsijmpL3L4:movdx,sianddx,0fhadddl,30hmovah,2int21hxorsi,siL5:cmpbx,10-13-計算機組成原理與匯編元程序設計實驗報告jcL6subbx,10incsijmpL5L6:movdx,sianddx,0fhadddl,30hmovah,2int21hxordx,dxmovdx,bxan
8、ddx,0fhadddl,30hmovah,2int21hretbtdendpbthprocmovdx,offsetbmovah,9int21hmovdx,offsetnum1movah,0ahint21hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hmovdi,offsetnum1movch,[di+1]K1:moval,[di+2]subal,30horbl,alro