deco05ie 0 Newbie Poster

Im making a simple sort program in tasm but im not very good, Iv got it to work with numbers (as seen below) but i have no idea how to get it to sort a list of strings in assembly

any help would be nice

title sort
.model small
.stack 100h
.data
	numlist		dw	3,4,1,9,5,2,8,6,7,10	; 
	numOfElements                 dw 1
	temp                 dw 1
.code
	extrn 	outdec :proc
	mov	ax,@data
	mov	ds,ax		        ; sets up the data segment register ds

	mov numOfElements, 20 	
	mov si, 0
	mov di, 0
	
posCounter:	
	changeCounter:
		mov cx, numlist[di]
		cmp numlist[si], cx
		jae alterOrder
		jb noAlter
		
		alterOrder:
			mov cx, numlist[si]
			mov temp, cx
			mov cx, numlist[di]
			mov numlist[si], cx
			mov cx, temp
			mov numlist[di], cx
		
		noAlter:
			add di, 2
			cmp di, numOfElements
			jb posCounter
		
		mov	ax,numlist[si]  	; output the ascii value
		call	outdec
					
		add si, 2
		cmp si, numOfElements

		mov di, si
		jb posCounter

	mov ah,4cH
	int 21H			        ; terminate program
end
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.