Bubble sort getting max number
Hey there ..
I did a bubble sort alp to sort a byte list in descending order .. the idea of the bubble sort is to compare between the first two elements then if one is bigger it goes to the beginning of the list ..
The list is for example: 2,4,1,3,7,9,11 .. NUMBER DB 2,4,1,3,7,9,11
That's the code :
MOV SI,O ; SI is the first number in the list
MOV DI,0 ; DI is the number compared with SI
Now, I want to get the maximum number .. what do you think if I take the value of SI at the end because it will be the maximum .. how can I do that in this code ?
Thanks guys .