Hi..
I don't have a nice assembler here at work but I got debug, so I'll post some debug-code..
But first... think about how you would do that task.. normally one would use a 2 step algorithm:
[A0] n=1; x <- [n]
[A1] see if the next number is bigger... if it is take it and discard the old number..
n <- n+1
if x<[n] : x <- [n]
[A2] repeat [A1] for each number [n]
and with some extra stuff around I got this:
(just copy&paste into a debug prompt)
---------
a 100
xor bp, bp
mov cx, [199]
mov ah, 9
mov dx, 162
int 21
mov ah,02
mov dx, [19B+bp]
add dx, 30
int 21
mov dl,20
int 21
add bp, 2
loop 10F
mov dl,a
int 21
mov dl,d
int 21
xor bp, bp
xor ax, ax
mov cx, [199]
mov dx, [19B+bp]
cmp ax, dx
jc 140
add bp, 2
loop 131
jmp 147
mov ax, dx
add bp, 2
loop 131
push ax
mov ax, 900
mov dx, 181
int 21
mov ah,02
pop dx
add dx, 30
int 21
mov dl,a
int 21
mov dl,d
int 21
int 20
e 162 "I will compare these numbers: $"
e 181 a,d,"This is the largest: $"
a 199
dw 5
dw 1,3,2,5,4
rcx
1A5
n largest.com
w
q
--------
You'll notice that the output will only work for numbers 0-9 any bigger and the simple +30 will result in strange output...
also, if you wanna change the amount of numbers (the first dw) and the numbers itself.. don't forget to add to the cx value (rcx)
you can trace through the program with t on the debug prompt...