Hello, I attempted to create a linked list in Assembly which takes the values from x and stores them into the list LinkNode. While it does work properly in doing this, I am unable to get any calls to procedures to work after calling my GetLink procedure. The calls seem to work if I comment out
mov esi, edx
specifically. Can anyone tell me why calls to procedures dont work after my call to GetLink?
INCLUDE Irvine32.inc
LLNode STRUCT
NodeData dword 0
NextNode dword 0
LLNode ENDS
Counter = 0
.data
x sdword 100, -100, 200, -200, -300, 300
LinkNode LLNode {6}
GetLink PROTO
.code
main PROC
invoke GetLink
mov esi,offset LinkNode
NextNode:
mov eax,[esi].LLNode.NodeData
cmp eax, NULL
je quit
;mov eax, [esi].LLNode.NodeData
mov eax, (LLNode PTR [esi]).NodeData
call WriteInt
call Crlf
mov esi, [esi].LLNode.NextNode
jmp NextNode
quit:
exit
main ENDP
GetLink Proc USES esi edi edx ebx
mov ecx, 6
mov esi, offset LinkNode
mov edi, offset x
mov edx, offset LinkNode + type LinkNode
StackData:
mov ebx, [edi]
mov (LLNode PTR [esi]).NodeData, ebx
mov (LLNode PTR [esi]).NextNode, edx
;mov [esi].LLNode.NodeData, ebx
;mov [esi].LLNode.NextNode, edx
call dumpregs
mov esi, edx
add edx, type LinkNode
add edi, type x
loop StackData
mov [esi].LLNode.NodeData, 0
ret
GetLink ENDP
END main