资源描述
实验五求最大值和最小值实验日期:2013-11-13学校:女徽农业大学经济技术学院星期:三 节次:1、2实验课时:姓名: 江珊珊学号:专业、班级: 通信三班 得分:1、实验目的(1)、学习子程序的泄义和调用方法。(2)、掌握子程序设计、调试。2、实验内容对内存中给泄的几个无符号字节数,求其最大值和最小值。3、实验步骤(1)在内存4000H4007H中写入任意八个字节的数。(2开始运行程序。4、实验运行结果: 编程代码如下所示:ORG 0100HSTART0:MOVSI,4000HMOVCX, 0008MAXMIN:MOVBH, SIMOVBL, BHCON2:LODSBCMPAL, BHJNAXIMOVBH, ALJMPX2XI:CMPAL, BLJNBX2MOVBL, ALX2:LOOP C0N2MOVAH, 4CHINT 21H结果截图如下所示:陽 8086 Microprocessor EmulatorFile Math Debug View Virtual Devices Virtual Drive Helpmemory (1 KJ atDijaswsmblc:p4C0 : |0200昵 External Memory ViewerE 磴洒前馥議二|CGF400BIOS DI INT021hsegnent0B560ReloadIPSingle Step0B56 一 : |0100Offset: Hex Dec ASCIIRegsteisSegmentsfhet:Hex Decimal ASCIIstep delay ms: 0HDX5A07exOO00DXOO00AXIP0204SS0B56SPFFF8DP0000SI4008DI00000110-F8 248? 0111: EB 235? 0112:06 006 3 0113: 3A058 : 0114: C3 195? 0115:73115s 0116:02 002 0117: 8A138 9 0118: D8 215? 0119: E2 225? 011A1EF239? 011B. B4 180? 011C:4C 076 L011D: CD 205?DS0B560088011E:21 033!011F:00 0000120:00 0000121:00 000ADD EX + SI, AL ADD EX* SI,AL ADD DX-SI,AL ADDEX*SItAL ADD EX* SI,AL ADD EX + SIL AL ADD EX + SI, AL ADD BX*SI,AL ADD BX*SI,AL ADD BX-SI,AL ADD EX* SI,AL ADD BX* SI. AL ADD EX* SI,AL ADD EX + Slt AL ADD BX + SItAL ADD EX* SI,AL % r%r ro5z /-sr a i0E56:W:0656:4001:0B56:4002:0856:4003:0856:4004: 0856:400!;!User ScreenActual SouceALULODSBCMP AL,BHJNfi X1offset0?00?080080210331羽068D5R090Z22n?n2221101?q00000NELL00000NHL00LIDONHL00000NULLDO000NULL00000NHL00000NELLDO000NULLnnanamu i5思考题解答按如下要求编写程序:设4000H单元开始有10个数,编程计算这十个数的平均值(存放在DH中),并统计这十个数中, 大于平均值的个数(存放在DL中)。找出这十个数的最大值和最小值(存在在BH和BL中)(1)其求平均值并将10个数中大于平均值的个数保存到DL中的编程如下所示:MOV SI.4000HMOVAX,0MOVBH,0ABC:MOVBL, SIADDAX, BXINCSILOOP ABCMOVCL, 10DIVCLMOVDH,ALMOVSI, 4000HMOVDL,0CONI:LODSBCMP AL, DHJNA XIINC DLXI:LOOP CONIMOV AH, 4CHINT 21H其执行结果截图(一)如下所示:鲂 - 8085 Microprocessor EmulatorFile Math Debug View Virtual Devices Virtual Drive HelpDXcsRcgii-tBPSIDSESoReloadmtep delay ms: 0lSingle Step000000001F05F40O02040B56FFF80000400A00000B560088rrorrQry (1K) al|0B56: |CM 00Offset Hex Dec ASCII0114 FO 240。 0115: BE 190? 0116: 00 000 0117 40 064 0118: B2 178- 0119 00 000 D11AAC172? 011B:3A058: D11C: C6198? 011D: 76 118v 011E: 02 002 011F FE 254 少 0120: C2194? 0121: E2 226? 0122: F7 247 9 0123: G4 180?User Scieen|F40OBIOS DIINTOglhADD 8X 卜 SI, AL ADD BX 卜 SI.AL ADD BX SI. AL ADD BX 4 SI, AL ADD BXSI,AL ADD BX*-SI,AL ADD BX a SI, AL ADD【BX 卜 SIL AL ADD 旧X a SI, AL ADD BX 亠 SI,AL ADD BX SI, AL ADD BX 卜 SI, AL ADD BX SI, AL ADD BX SI, AL ADD BX 卜 SI, AL ADD BX *- SI,ALActual SouceALUnbb:|()200 石 Fytamjil Mmcry Viowar. UJ I 回Show memory d: segment0B56oftset4000Segment: Off set Hex uecima ASCII0856:000;OB5&40O1: 0E56:1C02: 观56:4002: 0056:4004 伽56:4005: 伽56:4006: 0656:400?:0856:4008:的56:4009: 0E56:C0fi: 0B56:Single StepRunJstep delay ms: oDiacerrble: 8086 Microprocessor Emulator回 SReoster4C|035A0200000000memsy (1K) al:|0B56. |(MOOOffset; Hex Dec ASCIIF4003200csF400IP0204ss0B56SPFFF8BP0000SI400ADI0000DS0B56ES 0088010C:C71999 010D:76 118? 010E:04 004 01 OR 8A138。 0110: F8 248? 0111: EB 235? 0112:06 005 0 0113: 3A058 : 0114: C3 195? 0115:73 115 s 0116: 02 002 0117: 8A138? 0118: DB 216? 0119: E2 226? 011AEF 239? 011B: Bl 120? 011C: 4C 076 LBIOS DI INT 021tlIRET011D:CD205?ADD BX*3ljfAL ADD BX + SILAL ADD EX + SI), AL ADD BX*3l)fAL ADD (BX + SIJ.AL ADD BX + Slj,AL ADD BX*SItAL ADD IBX + SIJ.AL ADD EX + SIL AL ADD BX*SItAL ADD (BX + SILAL ADD BX + SIJ.AL ADD BX*SI,AL ADD |BX + SI),AL ADD BX + SI), AL ADD BX*SI)fALUser Screen Actual Source ALU Stack翔 External Memory Viev?erl a T 1Show rremory at:segmentoffset|0B56 : |4000Segment:OffsetHex Decimal ASCIIIB56:W:0856:4001:0856:4002:0356:40(8:0556X004: (B56:40C5: (B:40C6r(E56:4007:0356:40 的; (B96H0CH: OB56;40CO; (B56:LoadReloadSingle StepRjjn0B8806020202000002000000: S8184? 0001: 67 103 g 0002: OB 011 Z 0003: 8E142 7 0004: DS 216? 0006:84180?0006: 00 000 0007: 86182?0008: 00 0000000: BE 190?OOOA: 00 000 OOOB: 00 000 OOOC: E9 185?0000:QA010OOOE: 00 000ADD BX SIL ALACDBXSI.ALADDBX3lfAL ACD【BXSI.AL ACD【BXSI.AL ACDWSILAL ACDBSIAL ADD BX*-SI. AL ADD BX*-SI, AL ADD BX-SI. AL ADD WSIJ.AL ADD BX 4-SI, AL0E57:DBB: OE5?;03CC; OES?:OOCO: OB5?:ODCE: OEGTsODCF: 0BS?:D03D: OE5?:Oflll: OES?:OD12: OE5?:OB3: OK7:OflM; OES?:OB1S: OK?:OOJ6: DES?:O31?: 0ES7:DD18: 0657:0019: 0ES?:O31fl: OE5?:OMB:User ScreenAduai Source 1ALL!Stack | FLAG5 |(注:本资料素材和资料部分来自网络,仅供参考。请预览后才下载,期待您的好评 与关注!)
展开阅读全文