home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
largest.seq
< prev
next >
Wrap
Text File
|
1990-05-25
|
609b
|
16 lines
\ LARGEST.SEQ Return the largest element of an array of words
code largest ( a1 n1 --- a2 n2 )
pop cx \ count of array to search
pop bx \ starting address of array
mov ax, # 0 \ starting highest value = 0
mov dx, bx \ highest value addr = start address
here cmp 0 [bx], ax
u> if mov dx, bx
mov ax, 0 [bx]
then
add bx, # 2 \ bump to next element
loop
2push end-code