资源描述:
《汇编任意十六进制数转二进制并输出》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、WORD文档可编辑屏蔽方式:DATASEGMENTDATA0DB'Pleaseenterahexadecimalnumbersixteen:',0DH,0AH,'$'DATA2DB0DH,0AH,'OUT:$'DATA1DB100,0DUP(0)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEADX,DATA0MOVAH,9INT21HLEADX,DATA1MOVAH,0AHINT21HMOVCX,0MOVCL,DATA1+1ADDDX,CXMOVBX,DXMOVBYTEPTR[BX+2],'
2、$'MOVDX,0LEADX,DATA1+2MOVAH,9INT21HLEADX,DATA2MOVAH,9INT21HLEADI,DATA1+2NEXT:MOVAL,[DI]SUBAL,30HCMPAL,09HJANEXT3JMPNEXT1NEXT3:SUBAL,07HCMPAL,0FH技术资料专业分享WORD文档可编辑JANEXT4JMPNEXT1NEXT4:SUBAL,20HJMPNEXT1NEXT1:MOVBL,ALPUSHCXMOVCX,0MOVCX,4ROLBL,CLNEXT2:ROLBL,1MOVDL,BLANDDL,1ADDDL,30HMOVAH,2INT21H
3、LOOPNEXT2MOVDL,20HMOVAH,2INT21HPOPCXINCDILOOPNEXTMOVAH,4CHINT21HCODEENDSENDSTARTCF寄存器方式DATASEGMENTDATA0DB'Pleaseenterahexadecimalnumbersixteen:',0DH,0AH,'$'DATA2DB0DH,0AH,'OUT:$'DATA1DB100,0DUP(0)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEADX,DATA0技术资料专业分享WORD文档可编辑MOV
4、AH,9INT21HLEADX,DATA1MOVAH,0AHINT21HMOVCX,0MOVCL,DATA1+1ADDDX,CXMOVBX,DXMOVBYTEPTR[BX+2],'$'MOVDX,0LEADX,DATA1+2MOVAH,9INT21HLEADX,DATA2MOVAH,9INT21HLEADI,DATA1+2NEXT:MOVAL,[DI]SUBAL,30HCMPAL,09HJANEXT3JMPNEXT1NEXT3:SUBAL,07HCMPAL,0FHJANEXT4JMPNEXT1NEXT4:SUBAL,20HJMPNEXT1NEXT1:MOVBL,ALPUSHC
5、XMOVCX,0MOVCX,4ROLBL,CLNEXT2:ROLBL,1技术资料专业分享WORD文档可编辑MOVDL,0ADCDL,30HMOVAH,2INT21HLOOPNEXT2MOVDL,20HMOVAH,2INT21HPOPCXINCDILOOPNEXTMOVAH,4CHINT21HCODEENDSENDSTART运行结果:技术资料专业分享