the error is in AfterLoop skope in the line " mov [esi], [edi]" . how can I resolve this issue? ; The function for node removing (headptr, nodeToremove)
removeNode proc
headPtr = 8
nodeToRemove = headPtr + 4
push ebp
mov ebp, esp
push esi
push edi
push ebx
mov esi, headPtr[ebp] ; esi = head of list
mov edi, [esi] ; edi = second item
cmp esi, nodeToRemove[ebp] ; head = nodeToRemove?
jne NextNode
mov edi, esi ; edi ( = currNode) = head
mov esi, [esi] ; new head = head->next
jmp AfterLoop
NextNode:
cmp edi, nodeToRemove[ebp] ; currNode = node to remove?
je AfterLoop
mov esi, edi ; prev node = currNode
mov edi, [edi] ; currNode = currNode->next
jmp NextNode
AfterLoop:
mov [esi], [edi] ; error!!! prev->next = curr->next
pop ebx
pop edi
pop esi
pop ebp
ret 8
removeNode endp