把一个100D个字的DATA区里的最小偶数找出来,区里的数是我编程序时自己设好的,大家可以改一下啊!
data_seg segment
DATA dw 99,100,98 dup(7)
TEMP dw 100(?)
data_seg ends
code_seg segment
assume cs:code_seg,ds:data_seg
start: mov ax,data_seg
mov ds,ax
mov cx,100
mov bx,0
mov ax,0
mov si,ax
again: mov dx,DATA[si]
and dx,1h
jnz continue
mov TEMP[si],dx
continue: inc bx
add si,2
loop again
mov cx,bx
mov ax,0
mov si,ax
mov dx,TEMP[si]
cycle: cmp dx,TEMP[si+1]
jae next
mov dx,TEMP[si+1]
next: add si,2
loop next
mov ,ah,2
int 21h
code_seg ends
end start
评论