资源描述:
《8086汇编语言 实验二 顺序结构》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、1.将DX寄存器中的16位数分成4组,分别放在AL,BL,CL,DL中。DATASSEGMENTBLOCKDB0DH,0AH,'DL=','$'BLOCK1DB0DH,0AH,'CL=','$'BLOCK2DB0DH,0AH,'BL=','$'BLOCK3DB0DH,0AH,'AL=','$'ADB?BDB?BUFFDB?;此处输入数据段代码DATASENDSCODESSEGMENTASSUMECS:CODES,DS:DATASSTART:MOVAX,DATASMOVDS,AXMOVAX,1234HANDAX,0F0F0HMOVCL,4SHRAX,CLMOVAL,AHMOVBUFF,
2、ALLEADX,BLOCK3MOVAH,9INT21HADDBUFF,30HMOVDL,BUFFMOVAH,2INT21H;显示ALMOVDX,1234HMOVAX,DXANDAX,0F0FHMOVBL,AHLEADX,BLOCK2MOVAH,9INT21HADDBL,30HMOVDL,BLMOVAH,2INT21H;显示BLMOVAX,1234HANDAX,0F0F0HMOVCL,4SHRAX,CLMOVCL,ALMOVB,CLLEADX,BLOCK1MOVAH,9INT21HADDB,30HMOVDL,BMOVAH,2INT21HXORCL,CL;显示CLMOVAX,1234HA
3、NDAX,0F0FHMOVDL,ALMOVA,DLLEADX,BLOCKMOVAH,9INT21HADDA,30HMOVDL,AMOVAH,2INT21H;显示DL;此处输入代码段代码MOVAH,4CHINT21HCODESENDSENDSTART2.在内存单元BCD中的2位压缩BCD码转换成ASCⅡ码,并存入BUFF和BUFF+1单元,并显示出来。(提示:显示低4位BCD码的方法为取出该数,屏蔽高4位,再与30H相加,存入BUFF单元,再显示高4位的BCD码,方法为取出该数,右移4位,与30H相加,存入BUFF+1单元。)DATASSEGMENTBCDDB0ABHBUFFDB?DA
4、TASENDSCODESSEGMENTASSUMECS:CODES,DS:DATASSTART:MOVAX,DATASMOVDS,AXMOVDL,BCDANDDL,0FHLEABX,BUFFMOV[BX],DLADDBUFF,30HMOVDL,BUFFMOVAH,2INT21HMOVAL,BCDMOVCL,4SHRAL,CLMOV[BX+1],ALADDBUFF+1,30HMOVDL,BUFF+1MOVAH,2INT21H;此处输入代码段代码MOVAH,4CHINT21HCODESENDSENDSTART