How does CALL in Assembly work? Does it return again to execute the further instructions?

26 Views Asked by At
start:
    mov $0, %eax
    jmp two

one:
    mov $0x1234, %eax

two:
    cmp $0x1234, %eax
    je done
    call one
    mov $10, %eax

done:
    jmp done

I have a doubt that when cmp in two is called for the first time, it won't match, so it will go to previous instruction again when call one is called. But after that when it again comes to two, and je done is executed, will it directly go to done or will mov $10, %eax will also be executed?

I tried looking up the working of both jmp and call. I understood it, but can't really apply it.

0

There are 0 best solutions below