资源描述:
《云南大学 软件学院 汇编实验5》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、计算机组成原理与汇编元程序设计实验报告实验五80x86分支,循环,子程序,宏程序设计姓名:学号:序号:班级:分数:1.编写设计一个2,10,16进制的码制转换程序,要求:①程序有友好的运行界面;②输入任意类型进制的数据,转换为其余两种进制类型;③要求程序有方便的输入输出功能;④要求程序能够处理基本的错误信息;⑤程序的基本结构采用子程序结构;源程序:.8086.modelsmall.datastrdb0ah,0dh,'pleaseinput1to8tochoisethefunction',0ah,0dhdb'1.btd',0ah,0dhdb'2.bth
2、',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',0ah,0dh,'$'agaidb'Pleaseinputagain',0ah,0dh
3、,'$'wrdb'Awrongnumber!',0ah,0dh,'$'numdb6,?,6dup(?)num1db16,?,16dup(?).codestart:movax,@datamovds,axchoice:leadx,strmovah,9int21hmovah,1int21hjmpC1-13-计算机组成原理与汇编元程序设计实验报告again:movdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hjmpchoiceMo:movdx,offsetagaimovah,9int21hjmpchoiceC1:cmpal
4、,'1'jnzC2callbtdjmpagainC2:cmpal,'2'jnzC3callbthjmpagainC3:cmpal,'3'jnzC4calldthjmpagainC4:cmpal,'4'jnzC5calldtbjmpagainC5:cmpal,'5'jnzC6callhtbjmpagainC6:cmpal,'6'jnzC7callhtdjmpagainC7:cmpal,'7'-13-计算机组成原理与汇编元程序设计实验报告jnzC8jmpMoC8:cmpal,'8'jnzwrongen:movah,4chint21hwrong:leadx
5、,wrmovah,9int21hjmpMobtdprocmovdx,offsetbmovah,9int21hmovdx,offsetnum1movah,0ahint21hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hmovdi,offsetnum1movch,[di+1]zq2:movdl,[di+2]cmpdl,39hjgzqsubdl,30hjmpzq1zq:subdl,37hzq1:movdh,0orbx,dxcmpch,1jzzq3-13-计算机组成原理与汇编元程序设计实验报告rolbx,1zq3:i
6、ncdidecchjnzzq2xorsi,sijj1:cmpbx,10000jcjjsubbx,10000incsijmpjj1jj:movdx,sianddx,0fhadddl,30hmovah,2int21hxorsi,siL1:cmpbx,1000jcL2subbx,1000incsijmpL1L2:movdx,sianddx,0fhadddl,30hmovah,2int21hxorsi,siL3:cmpbx,100jcL4subbx,100incsijmpL3L4:movdx,sianddx,0fhadddl,30hmovah,2int21h
7、xorsi,siL5:cmpbx,10-13-计算机组成原理与汇编元程序设计实验报告jcL6subbx,10incsijmpL5L6:movdx,sianddx,0fhadddl,30hmovah,2int21hxordx,dxmovdx,bxanddx,0fhadddl,30hmovah,2int21hretbtdendpbthprocmovdx,offsetbmovah,9int21hmovdx,offsetnum1movah,0ahint21hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hmovdi,o
8、ffsetnum1movch,[di+1]K1:moval,[di+2]subal,30horbl,alro