그냥 어떻게 될지 잘 지켜보십시오. 함수 foo
을 호출 해 봅시다.
push eax ; address of foo on the stack
push eax ; address of foo on the stack again
ret ; picks off the top item from the stack, goes to foo
foo:
; body of function
ret ; picks off the top item from stack, which is still foo
; so invokes itself again
두 번째 예 : 이와 같이
push next_a ; address of next_a on the stack
push eax ; address of foo on the stack
ret ; picks off the top item from the stack, goes to foo
foo:
; body of function
ret ; picks off the top item from stack, which is next_a
next_a:
; execution continues here
먼저 전화 foo
을 두 버전. 어쨌든 foo
(XY 문제)으로 전화를 걸려면 call eax
을 사용하고 처리하십시오.
next_a는 내가 부르고 싶은 기능이다.
정말요? eax=next_a
이면 두 코드가 정확히 동일합니다.
더 많은 코드를 게시 할 수 있습니까? "next_a"란 무엇입니까? 질문 아래의 "수정"을 클릭하고 코드를 추가하십시오. –
이것은 내가 부르고 싶은 기능이다. 하지만이 함수의 주소가 EAX에 있다는 것을 알고 있습니다 ... –
이것은 시험에서 얻은 질문입니다. 나는 쉬운 전화가 다만 사용 전화다는 것을 알고있다; 교수는 첫 번째 예제가 작동하지 않는다고 말했고 나는 왜 –