السلام عليكم عندي استفسار كيف ممكن اكتب بروسيجر واستدعيه بالاسمبلي بتمنى توضيح ممل...
كيف ننشء بروسيجر؟؟
أعتقد انه يسأل عن الـProcedure أو الـfunctions أخي delta , تعرف اختلاف اللغات :D
.386 .model flat,stdcall option casemap:none include windows.inc include kernel32.inc include user32.inc includelib kernel32.lib includelib user32.lib .data Msg db "Nothing improtant !",0 _Title db "MessageBox Title",0 ;declare Procedure1 ;Function_Name proto Parameter No.1(optional):type, Parameter No.1(optional):type, ... and so on Procedure1 proto Param1:dword, Param2:dword .code start: ;call using the MASM 'invoke' word witch pushes the parameters in stack and call the function for you. ;you must declare the function prototypes "if" it exists after the call line ! invoke Procedure1,55,66h ret;end program ;-------------------------------------------------- Procedure1 proc Param1:dword, Param2:dword invoke MessageBox, 0, addr Msg, addr _Title, MB_OK ;fill registers with parameters mov esi, Param1 mov edi, Param2 ; call using the standard ASM method : pushing parameters to stack then call the function. ; no need to declare the called function ! push 5 call Procedure2 ; esi, edi and ebx haven't changed despite of using them in 'Procedure2' because of the word 'using esi edi ebx' ret Procedure1 endp ;-------------------------------------------------- Procedure2 proc uses esi edi ebx param1:dword ;local name:type ;it's the same as local variables in C/C++ which remains in the procedure stack frame LOCAL int1:dword LOCAL int2:dword ; change registers that will be saved and restored after executing the function xor esi, esi add edi, 5 and ebx, 7fffffffh invoke MessageBox, 0, addr Msg, addr _Title, MB_OK ret Procedure2 endp ;-------------------------------------------------- end start
الكود مدعم بالتعليقات , اذا اردت تفصيل عن شئ محدد أكثر فلا تتردد بالسؤال .
المشروع(RadAsm) في المرفقات
mov eax, dword ptr ds:[0xffdf0308]
jmp dword ptr [eax+0xfc]
انا مبتدىء بالاسمبلي وبستخدم ايميوليتر8086 لكتابة اكواد الاسمبلي بس مش عارف اعمل بروسيجر واستدعيه يعني على سبيل المثال بروسيجر يقرا بالديسمال او البناري او سترنق مثلا...
اقتباسايميوليتر8086
اقتباسبروسيجر
اقتباسبالديسمال
اقتباسالبناري
اقتباساو سترنق
أكتب المصطلحات باللغة الانجليزية أو الترجمة المناسبة لها بالعربية , ألم تقرأ الرد رقم (2) !!!!!!!!؟؟؟؟؟؟؟؟؟
كما اني لم أفهم ما تريد .
mov eax, dword ptr ds:[0xffdf0308]
jmp dword ptr [eax+0xfc]
وما الفرق ؟؟؟؟؟
Function == Procedure
كلاهما يندرج تحت مسمى الـSubroutine ويمكن تنفيذهم كما في أول مشاركة لي .
mov eax, dword ptr ds:[0xffdf0308]
jmp dword ptr [eax+0xfc]
تعريف برنامج فرعي ( الاجراء ) :
procedure_name PROC ; here your code RET procedure_name ENDP
استدعاء الاجراء :
CALL procedure_name
تم تعديل هذه المشاركة بواسطة MEGinCCSI في 20 أبريل 2008 في 03:23

