Let me start this by saying that I do know I am not supposed to be brute forcing the program, but I am at a bit of an impasse, the purpose is to use the elements of one array to basically "sort" the elements of another array.
Given:
start = 1
chars: H,A,C,E,B,D,F,G links: 0,4,5,6,2,3,7,0
So you'd start at the first element, A, which is also the number 4 in the links array, which points to the letter B in the chars array, and so on and so forth. The characters are stored in a new array in alphabetical order, where I am having trouble in is getting the index number of the chars array after every step, maybe the code will show a bit more where I am having trouble
INCLUDE Irvine32.inc
start = 1
.data
chars BYTE 'H','A','C','E','B','D','F','G'
links DWORD 0,4,5,6,2,3,7,0
array BYTE 0,0,0,0,0,0,0,0
.code
main PROC
mov al, chars +1
mov array, al
mov esi, start ; moves the start location into the esi register
mov eax, [links + 4] ; moves the second element of the array into eax
mov dl, chars[eax] ; moves the character element of the array chars into dl
mov array[esi], dl ; moves the character into the array
inc esi
mov eax, [links + 16]
mov dl, chars[eax]
mov array[esi], dl
inc esi
mov eax, [links + 8]
mov dl, chars[eax]
mov array[esi], dl
inc esi
mov eax, [links + 20]
mov dl, chars[eax]
mov array[esi], dl
inc esi
mov eax, [links + 12]
mov dl, chars[eax]
mov array[esi], dl
inc esi
mov eax, [links + 24]
mov dl, chars[eax]
mov array[esi], dl
inc esi
mov eax, [links + 28]
mov dl, chars[eax]
mov array[esi], dl
inc esi
main ENDP
END main
So I think if I just knew how to get the index of the array element after the "links" array points to it I think I could put it into a loop, I just need to know how to do that.