code segment
start:
mov bl,0
mov cx,10
loop1:
int 21h
mov ah,9
cmp al,bl
jg label
label:
mov bl,al
loop loop1
ends
end start
过程就是正样的,不过没有调试,自己改改吧
public class MaxTest {
/**
* @param args
*/
public static void main(String[] args) {
int[] num={1,2,3,4,5,6,7,8,9,10};
int max=num[0];
for(int i:num)
{
if(i>max)
max=i;
}
System.out.println("max="+max);
}
}