I’m learning the basics of assembly and I write this simple program to find the minimum number among a list of numbers. But when I run the program it will always return the value 0.
It works for finding the biggest number if I replace the jge start_loop with gle start_loop but not the other way. I’ll appreciate any help, thanks in advance.

Here is the code:

#PURPOSE: This program finds the minimum number among a set of numbers

#VARIABLES: The registers have the following uses:

# %edi - Holds the index of the data item being examined
# %ebx - Smallest data item found
# %eax - current data item
#The following data memory locations are used:

#data_items - contains the item data. A 0 is used to terminate the data

.section .data
data_items:                 #These are the data data items
    .long 3, 67, 34, 222, 45, 254, 255, 75, 54, 34, 44, 33, 22, 11, 66, 0, 300, 400

.section .text

.global _start
 movl $0, %edi          #move 0 into the index register
 movl data_items(, %edi, 4), %eax       #load the first byte of data
 movl %eax, %ebx        # since this is the first item, the %eax is the smallest

 start_loop:                #start loop
  cmpl $0, %eax             # check to see if we've hit the end
  je loop_exit
  incl %edi                 # load next value
  movl data_items(, %edi, 4), %eax
  cmpl %ebx, %eax           # compare values
  jge start_loop            # jump to loop beginning if the new one is bigger
  movl %eax, %ebx           # move the value as the smallest
  jmp start_loop            # jump to loop beginning
  # %ebx is the status code for the exit system call and it already had the minimum number
    movl $1, %eax
    int $0x80

try to find the minimum number among a list of numbers but getting always 0 as the result.