资源描述:
《西电微机原理上机题源程序(principle of microcomputer source program)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、西电微机原理上机题源程序(Principleofmicrocomputersourceprogram)ThefirstandsecondbigassignmentsThirty-seventhquestionsprogramcode:STACKSEGMENTSTACK'STACK'DW,100H,DUP(...)TOPLABELWORDSTACKENDSDATASEGMENTBUFFERLABELWORDX=17REPT100X=(X+80)mod43DWXENDMBUFDW100DUP(?)DATAENDSCODESEGMENTASSUME,CS:CODE,DS:DAT
2、A,ES:DATA,SS:STACKSTART:MOV,AX,DATAMOV,DS,AXMOV,ES,AXMOV,AX,STACKMOV,SS,AXLEA,SP,TOPMOVCX,100LEA,SI,BUFFERLEA,DI,BUFL1:MOV,AX,[SI]INCSIINCSIMOV,[DI],AXINCDIINCDILOOPL1MOVCX,100DECCXLEA,SI,BUFFERPUSHCXADD,CX,CXADD,SI,CXPOPCXL2:PUSHCXPUSHSIL3:MOV,AX,[SI]CMP,AX,[SI-2]JAENOXCHGXCHG,AX,[SI-2]M
3、OV,[SI],AXNOXCHG:SUBSI,2LOOPL3POPSIPOPCXLOOPL2MOVCX,100LEA,SI,BUFFERL4:MOV,AX,[SI]CALLDISPAXADDSI,2CALLXIAOYUCALLXUHAOCALLDAYUCALLDISPCRLOOPL4MOV,AH,4CHMOVAL,0INT21HDISPAXPROCNEARPUSHAXPUSHBXPUSHCXPUSHDXPUSHDIMOVBX,10MOVCX,3L7:XOR,DX,DXDIVBXMOV,[DI],DXINCDIINCDILOOPL7MOVCX,3L8:DECDIDECDIM
4、OV,AL,[DI]ADD,AL,30HMOVAH,02MOV,DL,ALINT21HLOOPL8POPDIPOPDXPOPCXPOPBXPOPAXRETDISPAXENDPDISPCRPROCNEARPUSHAXPUSHDXMOVAH,2MOV,DL,0AHINT21HMOVAH,2MOV,DL,0DHINT21HPOPDXPOPAXRETDISPCRENDPXIAOYUPROCNEARPUSHAXPUSHDXMOVAH,02MOV,DL,3CHINT21HPOPDXPOPAXRETXIAOYUENDPXUHAOPROCNEARPUSHAXPUSHBXPUSHCXPUS
5、HSIMOVCX,100MOV,BX,AXLEA,SI,BUFL5:CMP,BX,[SI]JZL6ADDSI,2LOOPL5L6:MOVAX,101SUB,AX,CXCALLDISPAXPOPSIPOPCXPOPBXPOPAXRETXUHAOENDPDAYUPROCNEARPUSHAXPUSHDXMOVAH,02MOV,DL,3EHINT21HPOPDXPOPAXRETDAYUENDPCODEENDSENDSTARTThirty-eighthquestionsprogramcode:STACKSEGMENTSTACK'STACK'DW,100H,DUP(...)TOPLA
6、BELWORDSTACKENDSDATASEGMENTBUFFERLABELBYTEX=17rept225x=(x+97)way50dbxendmboofdb45after(?)number6ondw(?)totaldb54h,6fh,74h,61h,6chletterdb41h,42h,43h,44h,45h,46hdb5indecimal(?)dataendscodesegmentassumecs:code,ds:data,ss:stack,es:lineup:purpleax,datapurpleds,axpurplees,axpurpleax,stackpurpl
7、ess,axleasp,topleaandbufferleadi,boppurplecx,45l1:pushcxpurplecx,5xorax,axl2:purplebl,[and]purplebh,0addax,bxaddax,50inc.andloopl2popcxpurplebl,5divblpurple[di],incdiloopl1leaand,whamleadi,numberpurplecx,6purpleax,0l3:purple[di],axincdiincdiloopl3purplecx,45purplebx