functions and arguments in stack - assembly - תכנות - HWzone פורומים
עבור לתוכן
  • צור חשבון

functions and arguments in stack - assembly


pain_killer12

Recommended Posts

hey everybody,

when i call a func in assembly, i'm pushing it's arguments first right?

so when i'm inside the func, where do they sit in the stack?

in the caller func, the var's set in -8ebp and -4ebp, but they are not there anymore

I know I'm messing with the stack pointer at the beginning of the func, but how

much did I move it? where are my vars?

I would appreciate an explantion, so that i would understand for all funcs.

Thanks a lot guys.

קישור לתוכן
שתף באתרים אחרים

אוקי, אז ככה

בעת קריאה לפונקציה מתבצע הדבר הבא

מצביע ההוראות ip נדחף גם הוא למחסנית על מנת שתיהיה כתובת חזרה

עכשיו הוא בגודל של 4 בייטים

דבר שני, המיקום יהיה ebp+8 ולא - מאחר והמחסנית הולכת מלמעלה(בכאילו) למטה

קישור לתוכן
שתף באתרים אחרים

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

×
  • צור חדש...