資源描述:
《匯編程序匯總.doc》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、設(shè)平面上一點p的直角坐標(biāo)為(x,y),x,y為字符號數(shù),試編制若P落在第i象限內(nèi),則令k=i;若P落在坐標(biāo)軸上,則令k=0的程序。stacksegmentstack'stack'dw32dup(0)stackendsdatasegmentxdw0ydw30kdb0dataendscodesegmentbeginprocfarassumess:stack,cs:code,ds:datapushdssubax,axpushaxmovax,datamovds,axmovax,xjzx0y0movax,yjzx0y0
2、movax,xjsx1movax,yjsy1movk,1jmpenddy1:movk,4jmpenddx1:movax,yjsy2movk,2jmpenddy2:movk,3jmpenddx0y0:movk,0jmpenddendd:movdl,kadddl,30hmovah,2int21hretbeginendpcodeendsendbegin編寫程序,將字節(jié)變量BVAR中的無符號二進制數(shù)(0~0FFH)轉(zhuǎn)換為BCD數(shù),在屏幕上顯示結(jié)果。stacksegmentstack‘stack’ dw32du
3、p(0)stackendsdatasegmentBVARDB99HOBUFDB4DUP(0)dataendscodesegmentbeginprocfar assumess:stack,cs:code,ds:data pushds subax,ax pushax movax,data movds,ax MOVAL,BVAR MOVAH,0 MOVDL,100 DIVDL ADDAL,30H Movobuf,al
4、 MOVAL,AH AAM ADDAX,3030H MOVOBUF+1,AH MOVOBUF+2,AL MOVOBUF+3,‘$’ MOVDXOFFSETOBUF MOVAH,9 INT21H retbeginendpcodeendsendbegin1.編寫源程序?qū)崿F(xiàn)以下功能:z=
5、x-y
6、。x、y、z均為字節(jié)變量。stacksegmentstack'stack'dw32dup(0)stackendsdatasegmentxdb12h
7、ydb10hzdb0dataendscodesegmentbeginprocfarassumess:stack,cs:code,ds:datapushdssubax,axpushaxmovax,datamovds,axmoval,xcmpal,yjgea1suby,almovah,ymovz,ahjmpexita1:subal,ymovz,alexit:retbeginendpcodeends編寫源程序?qū)崿F(xiàn)以下功能,在顯示器上顯示:Enterthestring:IamaChineseOutputthestri
8、ngagain:IamaChinesestacksegmentstack'stack'dw32dup(0)stackendsdatasegmentOBUFDB'Enterthestring:$'IBUFDB0FFH,0,255DUP(0)OBUF1dB'Outputthestringagain:$'dataendscodesegmentbeginprocfarassumess:stack,cs:code,ds:datapushdssubax,axpushaxmovax,datamovds,axMOVDX,OF
9、FSETOBUFMOVAH,9INT21Hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hMOVDX,OFFSETIBUFMOVAH,10INT21Hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hMOVDX,OFFSETOBUF1MOVAH,9INT21Hmovdl,0ahmovah,2int21hmovdl,0dhmovah,2int21hmovbl,ibuf+1movbh,0MOViBUF[BX+2],'$'MOVDX,OF
10、FSETibuf+2MOVAH,9INT21HRETbeginendpcodeendsendbegin編寫源程序?qū)崿F(xiàn)以下功能:將字節(jié)變量BVAR中存放的兩位壓縮BCD數(shù)轉(zhuǎn)換為二進制數(shù),并存入原字節(jié)變量中。程序運行后,如何查看字節(jié)變量BVAR中存放的內(nèi)容??1.stacksegmentstack'stack'dw32dup(0)stackendsdatasegmentsttDB10,0,10dup(0