Exploring the Future Potential of AI-Enabled Smartphone Processors
longjmp
1. Current instruction
Stack
call mylongjmp
void _fastcall
mylongjmp(myjmp_buf *, int)
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
ecx holds the first argument of
EDX EDI mylongjmp (fastcall of MSVC)
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
2. Current instruction
Stack
mov eax, edx
eax stores return value
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
edx holds the second argument
of mylongjmp (fastcall of MSVC) EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
3. Current instruction
Stack
mov edx, ecx
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
4. Current instruction
Stack
mov esp, [edx+4]
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
5. Current instruction
Stack
mov edi, esp
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
6. Current instruction
Stack
mov esi, [edx+24]
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
7. Current instruction
Stack
mov ecx, [edx+28]
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
8. Current instruction
Stack
cld
rep movsb
Callee frame
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
9. Current instruction
Stack
mov ebp, [edx+8]
Callee frame
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
10. Current instruction
Stack
mov ebx, [edx+12]
Callee frame
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
11. Current instruction
Stack
mov edi, [edx+16]
Callee frame
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
12. Current instruction
Stack
mov esi, [edx+20]
Callee frame
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=
13. Current instruction
Stack
jmp dword ptr [edx]
Callee frame
EIP ESP
EAX EBP
Ret. From mylongjmp
EBX ECX
EDX EDI
ESI Return address from
corresponding setjmp.
ETC… Registers
EIP ESP
EBP EBX
EDI ESI
Callee frame
Stack Len
myjmp_buf
=