微机原理问题!求最大数! DATA SEGMENT PARABUF DB\"52\",\"14\",\"56\",\"85\",\"34DB\"63\",\"38\",\"70\",\"18\",\"69COUNT EQU$-OFFSET BUFMAX DB 2 DUP?DATA ENDSCSEG SEGMENT PARA 'CODE'ASSUME CS:CSEG,DS:DATASTART:MOV AX,DATAMOV DS,AXMOV SI,OFFSET BUFMOV BX,OFFSET MAXMOV CX,COUNTMOV DH,[SI]MOV DL,[SI+1]INC SIINC SICOMP:LODSBMOV AH,ALLODSBCMP AX,DXJGE NEXTMOV DX,AXNEXT:DEC CXLOOP COMPMOV[BX],DHMOV[BX+1],DLPRINT:MOV BX,OFFSET MAXMOV DL,[BX]MOV AH,2INT 21HMOV DL,[BX+1]INT 21HMOV AH,4CHINT 21HCSEG ENDSEND START你看看这个能不能给你参考一下,我们用这个显示输出最大值。
微机原理中设计一个程序,求10个无符号数的最大值 DATA SEGMENTARY DW 025AH,1357H,776H,0040H,05C3H,36D0H,720FH,082AH,019DH,0124HORG 0050HMAX DW 0DATA ENDSCODE SEGMENTASSUME CS:CODE,ES:DATAORG 100HSTART:MOV CX,9H;循环次数=数据个数-1MOV AX,SEG ARYMOV ES,AXLEA SI,ARYMOV AX,ES:[SI];最大值初值SCHMAX:ADD SI,2MOV DX,ES:[SI]CMP DX,AXJLE NEXTMOV AX,DXJMP NEXTNEXT:LOOP SCHMAXFINISH:MOV ES:[MAX],AXINT 3;暂停,以便查e5a48de588b63231313335323631343130323136353331333335346135看运行结果CODE ENDSEND START编译链接生成exe文件,在Win7的DOS环境用Debug运行通过;运行结果,找到这10个数的最大值并保存到max单元中,在Debug中,运行至INT 3 暂停,可用 D ES:0050 命令查看到该最大值。
微机原理中输出最大值程序咋编 CODE SEGMENTASSUME CS:CODEARRAY DW 1,34,65,78,32,987,543,345,678,888,-3,-988,32767,32768NUM DW($-ARRAY)/2MAX DW-32768START:PUSH CSPOP DSPUSH CSPOP ESLEA SI,ARRAYMOV CX,NUMCLD16530:LODSWCMP AX,MAXJLE@1MOV MAX,AX1:LOOP@0MOV AX,MAXCALL DSPAXSMOV AH,4CHINT 21HDSPAXS PROC NEARPUSH AXOR AX,AXJNS@DSPAXS1PUSH AXPUSH DXMOV AH,2MOV DL,'-'INT 21HPOP DXPOP AXNEG AXDSPAXS1:CALL DSPAXPOP AXRETDSPAXS ENDPDSPAX PROC NEARPUSH AXPUSH BXPUSH CXPUSH DXPUSHFXOR CX,CXMOV BX,10DSPAX1:XOR DX,DXDIV BXINC CXOR DX,30HPUSH DXCMP AX,0JNE@DSPAX1MOV AH,2DISPAX2:POP DXINT 21HLOOP@DISPAX2POPFPOP DXPOP CXPOP BXPOP AXRETDSPAX ENDPCODE ENDSEND START