I have this program doing the fibonacci and I'm trying to implement the stacks and I think I'm doing it wrong because even if I comment out the push and pop calls it will still display the right numbers, any suggestions?
.data
count DWORD 12 ; Number of loops to perform
val1 DWORD ?
string byte (" "),0 ; use for the space between numbers
.code
main PROC
mov ecx, count ; loop counter
mov eax, 0
mov val1, 1
ADDLOOP: ; First time loop:
mov ebx, val1
mov val1, eax ; save current eax for our next addition
add eax, ebx
push eax
pop eax
call DisplaySum
loop ADDLOOP ; If not done, perform loop again (ecx is automatically decremented)
exit
main ENDP
DisplaySum PROC
call WriteInt ; Display number
mov edx, OFFSET string ; add space between the numbers
call WriteString
ret
DisplaySum ENDP
END main