N = 10
.data
v: .word 1,-2,3,4,5,6,7,8,9,-1
.bss
# If you don't align them to 4 bits
# ddd gets confused and shows min as max:min
.comm min,2,2
.comm max,2,2
.text
.global main
main:
	# The next 3 lines is cos we cannot do "movw v(,0,2), min"
	# Rb and Ri have to be alwas registers (and 32-bit registers).
	# So we need to move $0 to a register (%ecx).
	# And, we cannot have both operands in memory.
	# So we need a register (%dx) as a temporary place
	# The, we copy source variable to register.
	# And, then register to destination
	movl $0, %ecx
	movw v(,%ecx,2), %dx
	movw %dx, min
	movw %dx, max
	incl %ecx
loop:
	cmpl $N, %ecx
	jge end_loop

	movw v(,%ecx,2), %dx
	cmpw max, %dx
	jle else
	movw %dx, max
	jmp end_if
else:
	cmpw min, %dx
	jge end_if
	movw %dx, min
end_if:

	incl %ecx
	jmp loop
end_loop:

	movswl min, %ebx
	#movswl max, %ebx
	movl $1, %eax
	int $0x80

