资源描述:
《北京交通大学微机原理与接口技术上机作业》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、微机原理与接口技术上机作业4-18Microsoft(R)MacroAssemblerVersion6.1110/23/1216:33:54M18.ASMPage1-10000DATASEGMENT0000050A0F1419MBUFDB5,10,15,20,250005=0005COUNTEQU$-MBUFORG0020H00200005[NBUFDBCOUNTDUP(0)00]0025DATAENDS0000STACK1SEGMENTSTACK00000014[DW20DUP(?)0000]0028STACK1ENDS0000CODESEGMENTAS
2、SUMECS:CODE,DS:DATA,SS:STACK10000B8----RSTART:MOVAX,DATA00038ED8MOVDS,AX0005BB0000RMOVBX,OFFSETMBUF000881C30004ADDBX,COUNT-1000CBE0020RMOVSI,OFFSETNBUF000FB90005MOVCX,COUNT00128A07SAVE:MOVAL,[BX]00148804MOV[SI],AL00164BDECBX001746INCSI001849DECCX001975F7JNZSAVE001BB44CMOVAH,4CH001
3、DCD21INT21H001FCODEENDSENDSTART12Microsoft(R)MacroAssemblerVersion6.1110/23/1216:33:54M18.ASMSymbols2-1SegmentsandGroups:NameSizeLengthAlignCombineClassCODE..............16Bit001FParaPrivateDATA..............16Bit0025ParaPrivateSTACK1.............16Bit0028ParaStackSymbols:NameType
4、ValueAttrCOUNT.............Number0005hMBUF..............Byte0000DATANBUF..............Byte0020DATASAVE..............LNear0012CODESTART.............LNear0000CODE0Warnings0Errors124-20Microsoft(R)MacroAssemblerVersion6.1110/23/1216:38:04M20.ASMPage1-10000DATASEGMENT0000F7F8F9FAFB01R
5、AMDATADB-9,-8,-7,-6,-5,1,2,3,4,5,6,7,8,90203040506070809000E=000ECOUNTEQU$-RAMDATA000E000E[POSBUFDBCOUNTDUP(0)00]001C000E[NEGBUFDBCOUNTDUP(0)00]002A00POSNUMDB0002B00NEGNUMDB0002CDATAENDS0000STACK1SEGMENTSTACK00000014[DW20DUP(?)0000]0028STACK1ENDS0000CODESEGMENTASSUMECS:CODE,DS:DAT
6、A,SS:STACK1120000B8----RSTART:MOVAX,DATA00038ED8MOVDS,AX00058D1E0000RLEABX,RAMDATA0009BE000ERMOVSI,OFFSETPOSBUF000CBF001CRMOVDI,OFFSETNEGBUF000FB9000EMOVCX,COUNT00128A07LOP:MOVAL,[BX]0014A880TESTAL,80H00167806JSNEGATIVE00183C00CMPAL,0001A7F0BJGPOSITIVE001CEB12JMPGOLOP001E8805NEGAT
7、IVE:MOV[DI],AL002047INCDI0021FE06002BRINCNEGNUM0025EB09JMPGOLOP00278804POSITIVE:MOV[SI],AL002946INCSI002AFE06002ARINCPOSNUM002EEB00JMPGOLOP003043GOLOP:INCBX003149DECCX003275DEJNZLOP0034B44CMOVAH,4CH0036CD21INT21H0038CODEENDSENDSTART12Microsoft(R)MacroAssemblerVersion6.1110/23/1216
8、:38:04M20.ASMSymbols2-1Segmentsan