8086汇编求一组正整数{0x1223,0x1234,0x1434,0x2345,0x3412,0x1712}中的最大数并存在变量MAX中
程序员文章站
2022-06-07 09:08:01
...
编程求一组正整数{0x1223,0x1234,0x1434,0x2345,0x3412,0x1712}中的最大数并存在变量MAX中
DATAS SEGMENT
X DW 1254H,1234H,1434H,2345H,3412H,1712H
MAX DW ?
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
;代码从这里开始
MOV AX,X[0]
MOV SI,OFFSET X
MOV CX,5
KKK:INC SI
INC SI
CMP AX,[SI]
JG JJJ
MOV AX,[SI]
JJJ:
LOOP KKK
;我写的代码在这上面结束
MOV AH,4CH
INT 21H
CODES ENDS
END START